strom-research 1.35.0-beta.2 → 1.35.0-beta.3
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 +5 -1
- package/CHANGELOG.de.md +6 -1
- package/CHANGELOG.md +5 -1
- package/CHANGELOG.pl.md +5 -1
- package/assets/method/core.md +2 -1
- package/dist/commands/media.js +4 -3
- package/dist/commands/tasks.js +34 -9
- package/dist/core/books.js +43 -3
- package/dist/core/inboxwait.js +13 -3
- package/dist/core/schema.js +1 -1
- package/dist/core/tree.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.cs.md
CHANGED
|
@@ -7,7 +7,7 @@ Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou n
|
|
|
7
7
|
|
|
8
8
|
## 1.35.0
|
|
9
9
|
|
|
10
|
-
*Připravuje se: bety do 1.35.0-beta.
|
|
10
|
+
*Připravuje se: bety do 1.35.0-beta.3. Oddíl bude úplný s vydáním.*
|
|
11
11
|
|
|
12
12
|
- **Knihy s nejvíc úkoly:** strom řekne, které knihy archivů potřebuje nejvíc úkolů výzkumu – otevřených, odložených
|
|
13
13
|
i čekajících –, aby jedno ruční stažení posloužilo mnoha z nich najednou: v nabídce stromu (Co čeká › knihy s nejvíc
|
|
@@ -22,6 +22,10 @@ Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou n
|
|
|
22
22
|
nad knihou, jejíž snímky jsou na disku, přijde na řadu nejdřív další úkol téže knihy, nejvýš 5 sezení po sobě) má
|
|
23
23
|
každý výzkum svoje – nastaví se v aplikaci Strom, v nabídce stromu (Nastavení › Archivy › Knihy s nejvíc úkoly) nebo příkazem
|
|
24
24
|
`strom config set … --for-tree`. Odkaz z aplikace otevře složku knihy, bez terminálu.
|
|
25
|
+
- **Čekající úkol pod knihou, kterou je třeba prohledat:** úkol, který čeká na prohledání knihy na webu archivu, je
|
|
26
|
+
v Co čeká a v aplikaci Strom zařazený pod tou knihou, ne pod knihou, kde se našla stopa: pod knihou, kterou mu dal
|
|
27
|
+
agent (`strom task wait|edit --book`), jinak pod jedinou knihou, kterou jmenuje jeho text. Dokud se kniha teprve
|
|
28
|
+
hledá, čeká úkol bez knihy a pro jeho snímky se nenabízí složka jiné knihy.
|
|
25
29
|
- **Snímky uložené do složky knihy:** snímky uložené ručně do složky knihy, na kterou nečeká žádný úkol, si strom vezme
|
|
26
30
|
(most nebo příští sezení) podle čísla snímku v názvu a všechny úkoly té knihy je čtou z disku; soubory JPEG 2000
|
|
27
31
|
portálu, jehož názvy počítají snímek × 10 (MZA Brno), se přepočtou zpět.
|
package/CHANGELOG.de.md
CHANGED
|
@@ -7,7 +7,7 @@ Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Ins
|
|
|
7
7
|
|
|
8
8
|
## 1.35.0
|
|
9
9
|
|
|
10
|
-
*In Vorbereitung: die Betas bis 1.35.0-beta.
|
|
10
|
+
*In Vorbereitung: die Betas bis 1.35.0-beta.3. Der Abschnitt ist mit dem Release vollständig.*
|
|
11
11
|
|
|
12
12
|
- **Die Bücher mit den meisten Aufgaben:** strom sagt, welche Bücher der Archive die meisten Aufgaben der Forschung
|
|
13
13
|
brauchen – offene, zurückgestellte und wartende –, damit ein Herunterladen von Hand vielen davon auf einmal dient: im
|
|
@@ -25,6 +25,11 @@ Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Ins
|
|
|
25
25
|
Bilder auf der Festplatte sind, kommt zuerst eine weitere Aufgabe desselben Buchs, höchstens 5 Sitzungen nacheinander),
|
|
26
26
|
hat jede Forschung für sich – eingestellt in der Strom-App, im Menü von strom (Einstellungen › Archive › Bücher mit den meisten Aufgaben) oder
|
|
27
27
|
mit `strom config set … --for-tree`. Ein Link aus der App öffnet den Ordner eines Buchs, ohne Terminal.
|
|
28
|
+
- **Eine wartende Aufgabe unter dem zu durchsuchenden Buch:** Eine Aufgabe, die darauf wartet, dass ein Buch auf der
|
|
29
|
+
Seite eines Archivs durchsucht wird, steht in „Was wartet“ und in der Strom-App unter diesem Buch, nicht unter dem
|
|
30
|
+
Buch, in dem die Spur gefunden wurde: unter dem Buch, das ihr der Agent gibt (`strom task wait|edit --book`), sonst
|
|
31
|
+
unter dem einen Buch, das ihr Text nennt. Solange das Buch erst noch zu finden ist, wartet die Aufgabe unter keinem
|
|
32
|
+
Buch, und für ihre Bilder wird kein Ordner eines anderen Buchs angeboten.
|
|
28
33
|
- **Bilder, in den Ordner eines Buchs gespeichert:** Bilder, die von Hand in den Ordner eines Buchs gespeichert werden,
|
|
29
34
|
auf das keine Aufgabe wartet, nimmt strom (die Brücke oder die nächste Sitzung) nach der Bildnummer im Namen, und alle
|
|
30
35
|
Aufgaben des Buchs lesen sie von der Festplatte; JPEG-2000-Dateien eines Portals, dessen Namen das Bild × 10 zählen
|
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ The changes of each version in short. The full notes and the install lines are o
|
|
|
7
7
|
|
|
8
8
|
## 1.35.0
|
|
9
9
|
|
|
10
|
-
*In preparation: the betas up to 1.35.0-beta.
|
|
10
|
+
*In preparation: the betas up to 1.35.0-beta.3. The section is complete with the release.*
|
|
11
11
|
|
|
12
12
|
- **The books with the most tasks:** strom says which books of the archives most tasks of the research need — open,
|
|
13
13
|
put aside and waiting — so that one download by hand serves many of them at once: in strom's menu (What waits ›
|
|
@@ -23,6 +23,10 @@ The changes of each version in short. The full notes and the install lines are o
|
|
|
23
23
|
(`queue.sameBook`, off by default: after a session in a book whose images are on disk, another task of that book
|
|
24
24
|
comes first, at most 5 sessions in a row) are each research's own — set in the Strom app, in strom's menu (Settings ›
|
|
25
25
|
Archives › Books with the most tasks) or with `strom config set … --for-tree`. A link from the app opens a book's folder, no terminal.
|
|
26
|
+
- **A waiting task under the book to be searched:** a task that waits for a book to be searched on an archive's site
|
|
27
|
+
waits in what waits and in the Strom app under that book, not under the book where the trail was found: the book the
|
|
28
|
+
agent gives it (`strom task wait|edit --book`), else the one book its words name. While the book is still to be found,
|
|
29
|
+
the task waits under no book, and no folder of another book is offered for its images.
|
|
26
30
|
- **Images saved into a book's folder:** images saved by hand into the folder of a book that no task waits on are
|
|
27
31
|
taken by strom (the bridge, or the next session) by the image number in their names, and every task of the book reads
|
|
28
32
|
them from disk; a portal's JPEG 2000 files whose names count the image × 10 (MZA Brno) are counted back.
|
package/CHANGELOG.pl.md
CHANGED
|
@@ -7,7 +7,7 @@ Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia inst
|
|
|
7
7
|
|
|
8
8
|
## 1.35.0
|
|
9
9
|
|
|
10
|
-
*W przygotowaniu: bety do 1.35.0-beta.
|
|
10
|
+
*W przygotowaniu: bety do 1.35.0-beta.3. Sekcja będzie kompletna z wydaniem.*
|
|
11
11
|
|
|
12
12
|
- **Księgi z największą liczbą zadań:** strom mówi, których ksiąg archiwów potrzebuje najwięcej zadań badania –
|
|
13
13
|
otwartych, odłożonych i czekających –, aby jedno ręczne pobranie posłużyło wielu z nich naraz: w menu stroma (Co
|
|
@@ -24,6 +24,10 @@ Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia inst
|
|
|
24
24
|
zadanie tej samej księgi, najwyżej 5 sesji po kolei) ma każde badanie własne – ustawia się w aplikacji Strom, w menu
|
|
25
25
|
stroma (Ustawienia › Archiwa › Księgi z największą liczbą zadań) albo poleceniem `strom config set … --for-tree`. Link z aplikacji otwiera
|
|
26
26
|
folder księgi, bez terminala.
|
|
27
|
+
- **Czekające zadanie pod księgą do przeszukania:** zadanie, które czeka na przeszukanie księgi na stronie archiwum,
|
|
28
|
+
jest w „Co czeka” i w aplikacji Strom pod tą księgą, a nie pod księgą, w której znaleziono ślad: pod księgą, którą
|
|
29
|
+
nadał mu agent (`strom task wait|edit --book`), inaczej pod jedyną księgą, którą wymienia jego tekst. Dopóki księgę
|
|
30
|
+
trzeba dopiero znaleźć, zadanie czeka bez księgi i dla jego skanów nie jest proponowany folder innej księgi.
|
|
27
31
|
- **Skany zapisane do folderu księgi:** skany zapisane ręcznie do folderu księgi, na którą nie czeka żadne zadanie,
|
|
28
32
|
strom bierze (most albo następna sesja) według numeru skanu w nazwie, a wszystkie zadania tej księgi czytają je z
|
|
29
33
|
dysku; pliki JPEG 2000 portalu, którego nazwy liczą skan × 10 (MZA Brno), są przeliczane z powrotem.
|
package/assets/method/core.md
CHANGED
|
@@ -134,7 +134,8 @@ conclusion so the next researcher can follow it.
|
|
|
134
134
|
your voice. Say its kind (`--kind letter|family|web|other`) and, when known,
|
|
135
135
|
whom it waits on (`--to`), the request's text saved in notes/ (`--request
|
|
136
136
|
notes/<file>.md`), the site (`--url`); `strom task sent T…` only once the
|
|
137
|
-
user says the request went out.
|
|
137
|
+
user says the request went out. The book to search, not the one the trail
|
|
138
|
+
was found in: `--book B…`.
|
|
138
139
|
<!-- end -->
|
|
139
140
|
<!-- for link verify enrich intake locate -->
|
|
140
141
|
A new task whose images are not here
|
package/dist/commands/media.js
CHANGED
|
@@ -30,7 +30,7 @@ import { makeThumb, THUMB_SIZES } from "../core/thumbs.js";
|
|
|
30
30
|
import { batchFull, batchPath, batchRoom, noteBatch, openBatch } from "../core/batches.js";
|
|
31
31
|
import { readEntry, readZip } from "../core/zip.js";
|
|
32
32
|
import { fileBy, handFiles, taskForFile, taskPeople } from "../core/taskfiles.js";
|
|
33
|
-
import { askedNow, bookFolders, folderFiles, handedImages, inboxState, inboxWaitOf, inboxWaits, numberBookFiles, numberFiles, numbersForTask, registeredImages, SETTLE_MS,
|
|
33
|
+
import { askedNow, bookFolders, folderFiles, handedImages, inboxState, inboxWaitOf, inboxWaits, numberBookFiles, numberFiles, numbersForTask, registeredImages, SETTLE_MS, unsettled, webWaitBook } from "../core/inboxwait.js";
|
|
34
34
|
import { formatOf } from "../image/index.js";
|
|
35
35
|
import { pdfScans } from "../image/pdf.js";
|
|
36
36
|
import { readableFile } from "../core/readable.js";
|
|
@@ -116,7 +116,8 @@ export function wakeWaiting(tree, recordset, count, o = {}) {
|
|
|
116
116
|
// a task that waits for images of a book is woken by that book alone, whatever other books it names; the person's
|
|
117
117
|
// check of a site never (only the person answers it, as an archive's decision leaves it: core/archivewait.ts);
|
|
118
118
|
// somebody's answer (a letter, the family) only by the book it waits on, never by a book it merely works in; a site
|
|
119
|
-
// the person looks at also by the one book it works in (the images saved there
|
|
119
|
+
// the person looks at also by the book it is to be searched in, else the one book it works in (the images saved there
|
|
120
|
+
// are what it waited for)
|
|
120
121
|
const wakes = (t, b) => {
|
|
121
122
|
if (t.awaits)
|
|
122
123
|
return t.awaits.recordset === b;
|
|
@@ -125,7 +126,7 @@ export function wakeWaiting(tree, recordset, count, o = {}) {
|
|
|
125
126
|
return false;
|
|
126
127
|
const named = (t.waitingOn ?? "").includes(b);
|
|
127
128
|
if (kind === "web")
|
|
128
|
-
return named ||
|
|
129
|
+
return named || webWaitBook(tree, t)?.id === b;
|
|
129
130
|
return kind === "letter" || kind === "family" ? named : named || t.where.includes(b);
|
|
130
131
|
};
|
|
131
132
|
if (count) {
|
package/dist/commands/tasks.js
CHANGED
|
@@ -45,7 +45,7 @@ import { WAIT_KINDS } from "../core/model.js";
|
|
|
45
45
|
import { SENDABLE, waitKindOf, waitState } from "../core/waitkind.js";
|
|
46
46
|
import { requestNote, requestPath } from "../core/waiting.js";
|
|
47
47
|
import { addressesPerson } from "../core/impersonal.js";
|
|
48
|
-
import { BOOKS_MIN_TASKS, bookRows, booksOfTask, liveBook, minTasksOf, needsBooks, sameBookLine, tasksOfBook } from "../core/books.js";
|
|
48
|
+
import { BOOKS_MIN_TASKS, bookOfTask, bookRows, booksOfTask, liveBook, minTasksOf, needsBooks, sameBookLine, tasksOfBook } from "../core/books.js";
|
|
49
49
|
function written(tree) {
|
|
50
50
|
return lines(...tree.written.map((o) => o.summary));
|
|
51
51
|
}
|
|
@@ -345,7 +345,7 @@ function taskDetail(tree, t) {
|
|
|
345
345
|
// put aside by the archive: its own sentence in the research's language (back when research is switched on, no wake)
|
|
346
346
|
t.state === "parked" ? (t.heldBy === "archive" && t.parkedReason ? t.parkedReason : `parked ${parkedWhy(tree, t) ?? "(no reason recorded)"} — strom task wake ${t.id} to go on`) : undefined, `where ${where.join("\n ")}`,
|
|
347
347
|
// the other tasks of its books: done in one session, their images downloaded once
|
|
348
|
-
...(needsBooks(t) ? booksOfTask(tree, t).map((b, _, all) => sameBookLine(tree, t, b.id)?.replace(/^/u, all.length > 1 ? `book ${b.id}: ` : "book ")) : []), `why ${t.why}`, `done ${t.doneWhen}`, t.subject.length ? `about ${t.subject.join(" ")}` : undefined, t.result ? `result ${t.result}${t.produced?.length ? ` → ${t.produced.join(" ")}` : ""}` : undefined, searches.length ? "\nalready searched there\n" + table(searches.map((s) => [` ${s.id}`, s.result, truncate(s.question, 60), s.scope.years ?? ""])) : undefined, lessons.length ? "\nlessons for these record sets\n" + lessons.map((l) => ` ${l.id} ${l.rule}`).join("\n") : undefined, ...t.notes.map((n) => `note ${n.text}`), t.awaitsCheck ? `check the person checks ${t.awaitsCheck.url}: ${t.awaitsCheck.ask}` : undefined, t.state === "waiting" ? `waits ${waitSaid(tree, t)}` : undefined, t.state === "waiting" && t.wait?.to ? `to ${t.wait.to}` : undefined, request ? `text ${request}` : undefined, t.state === "waiting" && t.wait?.url ? `url ${t.wait.url}` : undefined,
|
|
348
|
+
...(needsBooks(t) ? booksOfTask(tree, t).map((b, _, all) => sameBookLine(tree, t, b.id)?.replace(/^/u, all.length > 1 ? `book ${b.id}: ` : "book ")) : []), `why ${t.why}`, `done ${t.doneWhen}`, t.subject.length ? `about ${t.subject.join(" ")}` : undefined, t.result ? `result ${t.result}${t.produced?.length ? ` → ${t.produced.join(" ")}` : ""}` : undefined, searches.length ? "\nalready searched there\n" + table(searches.map((s) => [` ${s.id}`, s.result, truncate(s.question, 60), s.scope.years ?? ""])) : undefined, lessons.length ? "\nlessons for these record sets\n" + lessons.map((l) => ` ${l.id} ${l.rule}`).join("\n") : undefined, ...t.notes.map((n) => `note ${n.text}`), t.awaitsCheck ? `check the person checks ${t.awaitsCheck.url}: ${t.awaitsCheck.ask}` : undefined, t.state === "waiting" ? `waits ${waitSaid(tree, t)}` : undefined, t.state === "waiting" && t.wait?.to ? `to ${t.wait.to}` : undefined, request ? `text ${request}` : undefined, t.state === "waiting" && t.wait?.url ? `url ${t.wait.url}` : undefined, t.state === "waiting" && t.wait?.book ? `book ${t.wait.book} — the book to be searched` : undefined,
|
|
349
349
|
// the person's own answers (only theirs: strom task wake --answer/--check), apart from the notes
|
|
350
350
|
...(t.answers ?? []).map((a) => `person ${a.at.slice(0, 10)} answered${a.givenIn === "app" ? " in the Strom app" : ""}${a.check ? ` ${a.check}` : ""}${a.answer ? `: ${a.whole ?? a.answer}` : ""} (asked: ${truncate(a.asked, 80)})`),
|
|
351
351
|
// the files that came for what it waited for: only that they came (strom intake --answers, the Strom app)
|
|
@@ -510,6 +510,7 @@ const WAIT_OPTIONS = [
|
|
|
510
510
|
{ name: "to", type: "string", value: "<whom>", description: "whom it waits on, as the user names them: the registry office, the archive, the family (impersonal)", max: 300 },
|
|
511
511
|
{ name: "request", type: "string", value: "notes/<file>.md", description: "the request's text, saved in the tree's notes/ first (the letter, the question to the family)" },
|
|
512
512
|
{ name: "url", type: "string", value: "<URL>", description: "the site it is about (http or https)" },
|
|
513
|
+
{ name: "book", type: "string", value: "<B…>", description: "the book the user is to search, when not the one --where names (where the trail was found)" },
|
|
513
514
|
];
|
|
514
515
|
/**
|
|
515
516
|
* A text the person reads (what a task waits for, whom): impersonal, never speaking as the agent — refused, with how to
|
|
@@ -521,7 +522,7 @@ function impersonal(tree, flag, text) {
|
|
|
521
522
|
throw new UsageError(`${flag} speaks to the user ("${word}"): they read it in strom's menu and the Strom app, where nothing addresses them nor speaks as the agent — say what is needed and from whom, impersonal, in the research language`, { hint: `e.g. --on "reply of the registry office of <place> to the request of <date>", --on "images 40-45 of the baptisms to be saved from <link>"`, code: "task.addresses", params: { flag, word } });
|
|
522
523
|
return text.trim();
|
|
523
524
|
}
|
|
524
|
-
/** What --kind, --to, --request and --
|
|
525
|
+
/** What --kind, --to, --request, --url and --book say of a wait, checked; undefined: none given. */
|
|
525
526
|
function waitOptions(tree, id, opts, has = {}) {
|
|
526
527
|
const wait = {};
|
|
527
528
|
if (opts.kind !== undefined) {
|
|
@@ -549,6 +550,18 @@ function waitOptions(tree, id, opts, has = {}) {
|
|
|
549
550
|
throw new UsageError(`--url takes an http(s) address — not "${raw}"`);
|
|
550
551
|
wait.url = new URL(raw).href;
|
|
551
552
|
}
|
|
553
|
+
if (opts.book !== undefined) {
|
|
554
|
+
const b = liveBook(tree, requireRecord(tree, String(opts.book).trim(), "recordset").id);
|
|
555
|
+
if (!b)
|
|
556
|
+
throw new UsageError(`--book: ${String(opts.book).trim()} was taken back — the book the user is to search is another one`, { hint: "strom recordset list" });
|
|
557
|
+
// --images names its book itself: the same one only repeats it (strom task wait checks it once the images are read)
|
|
558
|
+
if (typeof has.images === "string") {
|
|
559
|
+
if (b.id !== has.images)
|
|
560
|
+
throw new UsageError(`--book with --images: the images are of ${has.images} — the book they are saved for is that one`, { hint: "leave out --book" });
|
|
561
|
+
}
|
|
562
|
+
else
|
|
563
|
+
wait.book = b.id;
|
|
564
|
+
}
|
|
552
565
|
return Object.keys(wait).length ? wait : undefined;
|
|
553
566
|
}
|
|
554
567
|
/** What a waiting task says of its wait, in a line: its kind, where it is dealt with, sent or not. */
|
|
@@ -872,7 +885,7 @@ register({
|
|
|
872
885
|
tree: true,
|
|
873
886
|
writes: true,
|
|
874
887
|
description: "--where and --about replace the old values (repeat them for several). A task written before its books were\nknown is pointed at them here — that is how a locate task hands over to a link task.\n" +
|
|
875
|
-
"A waiting task: --on, --kind, --to, --request, --url change what it waits for (as strom task wait says
|
|
888
|
+
"A waiting task: --on, --kind, --to, --request, --url, --book change what it waits for (as strom task wait says\nthem) — how a task set waiting before gets its kind, whom it waits on and the book to be searched.",
|
|
876
889
|
args: [{ name: "task", description: "task ID", required: true }],
|
|
877
890
|
options: [
|
|
878
891
|
{ name: "what", type: "string", value: "<text>", description: "what to find" },
|
|
@@ -918,7 +931,7 @@ register({
|
|
|
918
931
|
if (typeof opts.helps === "string")
|
|
919
932
|
change.helps = helps;
|
|
920
933
|
// what a waiting task waits for: only a waiting task's
|
|
921
|
-
const waitAsked = ["on", "kind", "to", "request", "url"].filter((k) => opts[k] !== undefined);
|
|
934
|
+
const waitAsked = ["on", "kind", "to", "request", "url", "book"].filter((k) => opts[k] !== undefined);
|
|
922
935
|
if (waitAsked.length) {
|
|
923
936
|
const before = requireRecord(tree, id, "task");
|
|
924
937
|
if (before.state !== "waiting")
|
|
@@ -931,7 +944,7 @@ register({
|
|
|
931
944
|
if (before.awaitsCheck)
|
|
932
945
|
change.awaitsCheck = { ...before.awaitsCheck, ask: change.waitingOn };
|
|
933
946
|
}
|
|
934
|
-
const w = waitOptions(tree, id, opts, { images:
|
|
947
|
+
const w = waitOptions(tree, id, opts, { images: before.awaits ? (liveBook(tree, before.awaits.recordset)?.id ?? before.awaits.recordset) : false, check: !!before.awaitsCheck });
|
|
935
948
|
if (w)
|
|
936
949
|
change.wait = { ...before.wait, ...w };
|
|
937
950
|
}
|
|
@@ -1112,6 +1125,9 @@ register({
|
|
|
1112
1125
|
"otherwise are taken by their order when there are as many as images missing.\n" +
|
|
1113
1126
|
"--kind web on a task whose --where names one book: images of that book saved into its folder of the inbox bring it\n" +
|
|
1114
1127
|
"back too (which ones not known yet) — with the numbers known, --images in its place (it says the kind itself).\n" +
|
|
1128
|
+
"--book B…: the book the user is to search when it is not the one --where names (where the trail was found) — a\n" +
|
|
1129
|
+
"record set you added for it: the task waits under it in What waits and the Strom app, and with --kind web images\n" +
|
|
1130
|
+
"saved into its folder bring it back.\n" +
|
|
1115
1131
|
"--check <URL>: the user looks at a site strom and your web tools may not read (it refused strom, or its terms\n" +
|
|
1116
1132
|
"forbid or restrict automation) — only after another way to the same records was tried and the blocked way recorded\n" +
|
|
1117
1133
|
"in this session (strom search add … --note \"<host>: …\"); --on says what to check there. They answer in strom's\n" +
|
|
@@ -1141,12 +1157,12 @@ register({
|
|
|
1141
1157
|
if (!opts.on)
|
|
1142
1158
|
throw new UsageError("--on is required", { hint: 'e.g. --on "reply of the archive to the request of 21 Sep"' });
|
|
1143
1159
|
const on = impersonal(tree, "--on", String(opts.on));
|
|
1144
|
-
const wait = waitOptions(tree, normId(args[0], "task"), opts, { images: opts.images !== undefined, check: opts.check !== undefined });
|
|
1145
1160
|
let awaits;
|
|
1146
1161
|
let awaitsCheck;
|
|
1147
1162
|
let b;
|
|
1148
1163
|
if (opts.check !== undefined && opts.images !== undefined)
|
|
1149
1164
|
throw new UsageError("--check or --images, not both: the check first; the images by hand after the user's answer");
|
|
1165
|
+
const wait = waitOptions(tree, normId(args[0], "task"), opts, { images: opts.images !== undefined, check: opts.check !== undefined });
|
|
1150
1166
|
if (opts.check !== undefined)
|
|
1151
1167
|
awaitsCheck = { url: checkUrl(ctx, tree, normId(args[0], "task"), String(opts.check)), ask: on };
|
|
1152
1168
|
if (opts.images !== undefined) {
|
|
@@ -1157,6 +1173,12 @@ register({
|
|
|
1157
1173
|
b = requireRecord(tree, m[1], "recordset");
|
|
1158
1174
|
awaits = { recordset: b.id, images: runs(nums), folder: inboxFolderFor(b) };
|
|
1159
1175
|
}
|
|
1176
|
+
if (b && wait?.book) {
|
|
1177
|
+
// --images names its book itself: the same one only repeats it
|
|
1178
|
+
if (wait.book !== (liveBook(tree, b.id)?.id ?? b.id))
|
|
1179
|
+
throw new UsageError(`--book with --images: the images are of ${b.id} — the book they are saved for is that one`, { hint: "leave out --book" });
|
|
1180
|
+
delete wait.book;
|
|
1181
|
+
}
|
|
1160
1182
|
const id = normId(args[0], "task");
|
|
1161
1183
|
const task = tree.get(id);
|
|
1162
1184
|
const where = b && task && !task.where.includes(b.id) ? { where: [...task.where, b.id] } : {};
|
|
@@ -1167,9 +1189,12 @@ register({
|
|
|
1167
1189
|
// a site the person looks at for the one book the task works in: images of it saved into its folder bring it back
|
|
1168
1190
|
const byBook = !awaits ? inboxWaitOf(tree, t) : undefined;
|
|
1169
1191
|
if (!awaits && !byBook) {
|
|
1170
|
-
const
|
|
1192
|
+
const kind = waitKindOf(t);
|
|
1193
|
+
const sendable = SENDABLE.includes(kind);
|
|
1171
1194
|
return {
|
|
1172
|
-
text: lines(written(tree), `waits ${waitSaid(tree, t)}`, sendable ? `once the user says the request went out: strom task sent ${t.id} — the task still waits for the reply` : `comes back with the user's answer (strom's menu, What waits; the Strom app)
|
|
1195
|
+
text: lines(written(tree), `waits ${waitSaid(tree, t)}`, sendable ? `once the user says the request went out: strom task sent ${t.id} — the task still waits for the reply` : `comes back with the user's answer (strom's menu, What waits; the Strom app)`,
|
|
1196
|
+
// a site the person looks at or checks, its book not known: the book to be searched, once there is one
|
|
1197
|
+
(kind === "web" || kind === "check") && !bookOfTask(tree, t) ? `the book the user is to search, once it is a record set (strom recordset add): strom task edit ${t.id} --book B… — the task then waits under it` : undefined),
|
|
1173
1198
|
data: { task: t, ...waitState(tree, t) },
|
|
1174
1199
|
};
|
|
1175
1200
|
}
|
package/dist/core/books.js
CHANGED
|
@@ -8,6 +8,7 @@ import { inboxFolderFor, parseImageList } from "./media.js";
|
|
|
8
8
|
import { runs } from "../cli/format.js";
|
|
9
9
|
import { BOOKS_MIN_TASKS, Settings } from "./config.js";
|
|
10
10
|
import { hostOf, wholeBookFor } from "./terms.js";
|
|
11
|
+
import { waitKindOf } from "./waitkind.js";
|
|
11
12
|
/** How many tasks a book needs for the offer to download it, unless the setting books.minTasks says otherwise. */
|
|
12
13
|
export { BOOKS_MIN_TASKS };
|
|
13
14
|
/** The states of a task that still needs its book: to do, at work, put aside, waiting. */
|
|
@@ -16,6 +17,10 @@ const COUNTED = new Set(["open", "doing", "parked", "waiting"]);
|
|
|
16
17
|
const DOWNLOADABLE = new Set(["online-free", "online-login"]);
|
|
17
18
|
/** A record set's ID as a task's where names it. */
|
|
18
19
|
const BOOK_ID = /^B\d{4,}$/u;
|
|
20
|
+
/** A record set's ID within a task's words (waitingOn): bounded by no letter, mark or digit — in any script. */
|
|
21
|
+
const BOOK_ID_IN = /(?<![\p{L}\p{M}\p{N}])B\d{4,}(?![\p{L}\p{M}\p{N}])/gu;
|
|
22
|
+
/** A record's ID as a where names it (a book B…, an archive R…): no free text. */
|
|
23
|
+
const RECORD_ID = /^\p{Lu}\d{4,}$/u;
|
|
19
24
|
/** At most this many task IDs named in a sentence to the agent (the rest counted). */
|
|
20
25
|
export const SAME_BOOK_IDS_MAX = 10;
|
|
21
26
|
/** Whether a task still needs its books: open, at work, put aside or waiting — and work in a book, not a decision. */
|
|
@@ -34,6 +39,8 @@ export function booksOfTask(tree, t) {
|
|
|
34
39
|
const ids = new Set(t.where.map((w) => w.trim()).filter((w) => BOOK_ID.test(w)));
|
|
35
40
|
if (t.awaits?.recordset)
|
|
36
41
|
ids.add(t.awaits.recordset);
|
|
42
|
+
if (t.state === "waiting" && t.wait?.book)
|
|
43
|
+
ids.add(t.wait.book);
|
|
37
44
|
const out = new Map();
|
|
38
45
|
for (const id of ids) {
|
|
39
46
|
const b = liveBook(tree, id);
|
|
@@ -42,14 +49,47 @@ export function booksOfTask(tree, t) {
|
|
|
42
49
|
}
|
|
43
50
|
return [...out.values()];
|
|
44
51
|
}
|
|
52
|
+
/** The books a task's where names, as they stand, each once (by their IDs). */
|
|
53
|
+
function whereBooks(tree, t) {
|
|
54
|
+
return new Set(t.where.map((w) => w.trim()).filter((w) => BOOK_ID.test(w)).map((w) => liveBook(tree, w)?.id).filter((x) => !!x));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The book a waiting task is to be searched in, when it is not the one book its where names (that one may be only where
|
|
58
|
+
* the trail was found: a note in a book of births pointing to the marriages of another parish) — read, nothing written:
|
|
59
|
+
* - the book the agent gave it (strom task wait|edit --book: wait.book);
|
|
60
|
+
* - else the one book its words name (waitingOn) beyond its where: an ID is the same in every language;
|
|
61
|
+
* - else none (null) for a site the person looks at or checks (kind web, check) whose where names one book beside a
|
|
62
|
+
* place or book in words (one still to be found): better no book than the book of the trail.
|
|
63
|
+
* undefined: none of these — the task's book is the one its where names. Not for a task waiting for images by their
|
|
64
|
+
* numbers (awaits says the book), nor for a task not waiting (the queue: the book a session reads is its where's).
|
|
65
|
+
*/
|
|
66
|
+
export function waitTarget(tree, t) {
|
|
67
|
+
if (t.state !== "waiting" || t.awaits)
|
|
68
|
+
return undefined;
|
|
69
|
+
const given = t.wait?.book ? liveBook(tree, t.wait.book) : undefined;
|
|
70
|
+
if (given)
|
|
71
|
+
return given;
|
|
72
|
+
const where = whereBooks(tree, t);
|
|
73
|
+
const named = new Set([...(t.waitingOn ?? "").normalize("NFC").matchAll(BOOK_ID_IN)].map((m) => liveBook(tree, m[0])?.id).filter((x) => !!x && !where.has(x)));
|
|
74
|
+
if (named.size === 1)
|
|
75
|
+
return liveBook(tree, [...named][0]) ?? undefined;
|
|
76
|
+
const kind = waitKindOf(t);
|
|
77
|
+
if ((kind === "web" || kind === "check") && where.size === 1 && t.where.some((w) => w.trim() && !RECORD_ID.test(w.trim())))
|
|
78
|
+
return null;
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
45
81
|
/**
|
|
46
|
-
* The one book a task is about, for the Strom app's groups by book (spec 105): the book it waits for (awaits), else
|
|
47
|
-
*
|
|
82
|
+
* The one book a task is about, for the Strom app's groups by book (spec 105): the book it waits for (awaits), else for
|
|
83
|
+
* a waiting task the book it is to be searched in (waitTarget: none when that is not known), else the one book its
|
|
84
|
+
* where names — as they stand. Several books, or none: undefined.
|
|
48
85
|
*/
|
|
49
86
|
export function bookOfTask(tree, t) {
|
|
50
87
|
if (t.awaits?.recordset)
|
|
51
88
|
return liveBook(tree, t.awaits.recordset)?.id;
|
|
52
|
-
const
|
|
89
|
+
const target = waitTarget(tree, t);
|
|
90
|
+
if (target !== undefined)
|
|
91
|
+
return target?.id;
|
|
92
|
+
const ids = whereBooks(tree, t);
|
|
53
93
|
return ids.size === 1 ? [...ids][0] : undefined;
|
|
54
94
|
}
|
|
55
95
|
const byId = (a, b) => a.localeCompare(b, undefined, { numeric: true });
|
package/dist/core/inboxwait.js
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
// once all of them are registered — a part of them, it waits on and says which are missing;
|
|
7
7
|
// - a site the person looks at (kind web) of a task whose `where` names one book alone: the images of that book saved
|
|
8
8
|
// into its folder (inboxFolderFor), which numbers not known — any of them bring it back. A task strom 1.26 set
|
|
9
|
-
// waiting so is woken the same way: nothing of it to rewrite.
|
|
9
|
+
// waiting so is woken the same way: nothing of it to rewrite. The book to be searched, when it is not that one
|
|
10
|
+
// (core/books.ts waitTarget: the book given with --book, else the one its words name beyond its where): its folder;
|
|
11
|
+
// a book still to be found (a place in words beside the book of the trail): no folder.
|
|
10
12
|
//
|
|
11
13
|
// The files of a folder are numbered by their names (the number the portal's viewer counts); named otherwise (a
|
|
12
14
|
// screenshot's time, a download's own name), by their order when there are as many as images missing; else nothing is
|
|
@@ -21,7 +23,7 @@ import fs from "node:fs";
|
|
|
21
23
|
import path from "node:path";
|
|
22
24
|
import { collectFiles, IMAGE_FILE_EXT, imageNumbers, inboxFolderFor, numberInName, parseImageList } from "./media.js";
|
|
23
25
|
import { waitKindOf } from "./waitkind.js";
|
|
24
|
-
import { booksOfTask, needsBooks } from "./books.js";
|
|
26
|
+
import { booksOfTask, needsBooks, waitTarget } from "./books.js";
|
|
25
27
|
import { imageFileTimesOf } from "./knownterms.js";
|
|
26
28
|
import { hostOf } from "./terms.js";
|
|
27
29
|
import { imagesIndex } from "./mediaindex.js";
|
|
@@ -36,6 +38,14 @@ export function singleBook(tree, t) {
|
|
|
36
38
|
const b = tree.get(ids[0]);
|
|
37
39
|
return b && !b.retracted && !b.mergedInto ? b : undefined;
|
|
38
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The book whose images saved by hand bring back a task waiting for a site the person looks at: the book it is to be
|
|
43
|
+
* searched in (core/books.ts waitTarget), else the one book its where names; none when that is not known.
|
|
44
|
+
*/
|
|
45
|
+
export function webWaitBook(tree, t) {
|
|
46
|
+
const target = waitTarget(tree, t);
|
|
47
|
+
return target === undefined ? singleBook(tree, t) : (target ?? undefined);
|
|
48
|
+
}
|
|
39
49
|
/** What a task waits for in the shared inbox, if it does. */
|
|
40
50
|
export function inboxWaitOf(tree, t) {
|
|
41
51
|
if (t.state !== "waiting")
|
|
@@ -44,7 +54,7 @@ export function inboxWaitOf(tree, t) {
|
|
|
44
54
|
return { task: t.id, recordset: t.awaits.recordset, folder: t.awaits.folder, want: parseImageList(t.awaits.images) ?? [], by: "images" };
|
|
45
55
|
if (t.awaitsCheck || t.awaitsPermission || waitKindOf(t) !== "web")
|
|
46
56
|
return undefined;
|
|
47
|
-
const b =
|
|
57
|
+
const b = webWaitBook(tree, t);
|
|
48
58
|
return b ? { task: t.id, recordset: b.id, folder: inboxFolderFor(b), by: "web" } : undefined;
|
|
49
59
|
}
|
|
50
60
|
/** Every task of the research waiting for images in the shared inbox. */
|
package/dist/core/schema.js
CHANGED
|
@@ -119,7 +119,7 @@ export const SCHEMAS = {
|
|
|
119
119
|
awaits: { t: "object", of: { recordset: R("recordset", true), images: S({ req: true, max: 200 }), folder: S({ req: true, max: 200 }) } },
|
|
120
120
|
awaitsCheck: { t: "object", of: { url: S({ req: true, max: 2000 }), ask: S({ req: true }) } },
|
|
121
121
|
awaitsPermission: { t: "object", of: { hosts: { t: "strings", req: true, min: 1 }, since: S({ req: true }), title: S({ max: 300 }) } },
|
|
122
|
-
wait: { t: "object", of: { kind: S({ enum: WAIT_KINDS }), to: S({ max: 300 }), note: S({ max: 500 }), url: S({ max: 2000 }) } },
|
|
122
|
+
wait: { t: "object", of: { kind: S({ enum: WAIT_KINDS }), to: S({ max: 300 }), note: S({ max: 500 }), url: S({ max: 2000 }), book: R("recordset") } },
|
|
123
123
|
sent: { t: "object", of: { at: S({ req: true }), by: S({ req: true }) } },
|
|
124
124
|
answers: { t: "array", of: { by: S({ req: true, enum: ["person"] }), asked: S({ req: true }), url: S({ max: 2000 }), check: S({ enum: CHECK_ANSWERS }), answer: S({ max: 500 }), at: S({ req: true }), via: S({ enum: ["terminal", "window"] }), givenIn: S({ enum: ["app"] }), whole: S({ max: 4000 }) } },
|
|
125
125
|
files: { t: "array", of: { input: R(["input", "media"], true), by: S({ req: true, max: 100 }), asked: S({ req: true }), at: S({ req: true }) } },
|
package/dist/core/tree.js
CHANGED
|
@@ -32,7 +32,7 @@ export const TREE_FILE = "strom.json";
|
|
|
32
32
|
export const SEAL_FOREIGN = "seal.foreign";
|
|
33
33
|
// between releases the candidate being made (a bridge run from the sources says what it is: the Strom app goes by it);
|
|
34
34
|
// at a release the release's own (package.json)
|
|
35
|
-
export const VERSION = "1.35.0-beta.
|
|
35
|
+
export const VERSION = "1.35.0-beta.3";
|
|
36
36
|
/** What a new research is settled with from the start: nothing an older strom counted otherwise to set right in it. */
|
|
37
37
|
export const NEW_TREE_SETTLED = ["readers-1", "proven-originals-1", "origins-1", "verify-originals-1", "origins-tree-1"];
|
|
38
38
|
const GITIGNORE = `# Strom Research — local state and large files are not versioned
|