strom-research 1.35.0 → 1.36.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 +45 -0
- package/CHANGELOG.de.md +53 -0
- package/CHANGELOG.md +48 -0
- package/CHANGELOG.pl.md +47 -0
- package/assets/lang/cs.json +47 -5
- package/assets/lang/de.json +47 -5
- package/assets/lang/pl.json +46 -4
- package/assets/plugins/gates/claude-usage/gate.ts +94 -16
- package/dist/cli/help.js +2 -2
- package/dist/cli/menu-links.js +58 -11
- package/dist/cli/menu-settings.js +19 -0
- package/dist/cli/menu-waiting.js +50 -1
- package/dist/cli/ui.js +41 -5
- package/dist/commands/analysis.js +20 -1
- package/dist/commands/guide.js +4 -1
- package/dist/commands/index.js +1 -0
- package/dist/commands/intake.js +32 -9
- package/dist/commands/links.js +10 -6
- package/dist/commands/media.js +166 -32
- package/dist/commands/setup.js +6 -0
- package/dist/commands/sourceretract.js +139 -0
- package/dist/commands/sources.js +42 -13
- package/dist/commands/sync.js +5 -3
- package/dist/commands/tasks.js +37 -9
- package/dist/commands/verify.js +7 -4
- package/dist/core/actions.js +11 -9
- package/dist/core/busy.js +9 -0
- package/dist/core/changelog.js +17 -0
- package/dist/core/config.js +7 -0
- package/dist/core/evidence.js +16 -0
- package/dist/core/import.js +9 -3
- package/dist/core/inboxwait.js +133 -15
- package/dist/core/inboxwatch.js +5 -4
- package/dist/core/links.js +13 -2
- package/dist/core/live.js +368 -33
- package/dist/core/material.js +12 -5
- package/dist/core/materialdelete.js +97 -23
- package/dist/core/media.js +4 -0
- package/dist/core/origin.js +16 -6
- package/dist/core/phrases.js +6 -0
- package/dist/core/queue.js +12 -4
- package/dist/core/report.js +1 -1
- package/dist/core/samescan.js +359 -0
- package/dist/core/sort.js +1 -1
- package/dist/core/sourcefields.js +16 -0
- package/dist/core/sourceretract.js +531 -0
- package/dist/core/sync.js +152 -7
- package/dist/core/taskaudit.js +104 -6
- package/dist/core/taskkind.js +58 -0
- package/dist/core/tree.js +1 -1
- package/dist/core/verify.js +12 -6
- package/dist/core/verifyfacts.js +7 -0
- package/dist/core/waiting.js +22 -3
- package/dist/core/waitkept.js +2 -0
- package/dist/gedcom/export.js +32 -9
- package/dist/gedcom/validate.js +8 -3
- package/dist/image/index.js +6 -3
- package/dist/image/jpeg-decode.js +80 -21
- package/package.json +4 -1
package/assets/lang/pl.json
CHANGED
|
@@ -203,7 +203,11 @@
|
|
|
203
203
|
"ui.consent.sort": "Posortować {n, plural, one {# plik} few {# pliki} many {# plików} other {# pliku}} materiału przez czytelników badania: dla każdego propozycja tytułu, daty, rodzaju i miejsc w drzewie, nic nie zostanie zapisane. Płatne odczyty (około {readings, plural, one {# odczyt} few {# odczyty} many {# odczytów} other {# odczytu}} agenta). Uruchomić?",
|
|
204
204
|
"ui.consent.sort.no": "Nic nie posortowano.",
|
|
205
205
|
"ui.consent.delete": "Usunąć na zawsze {n, plural, one {# plik} few {# pliki} many {# plików} other {# pliku}} materiału: znika zapis każdego i jego miejsca w drzewie; źródło z niego zachowuje tekst i cytowania. W aplikacji Strom nie da się tego cofnąć – plik zostaje tylko we wcześniejszych kopiach zapasowych badania. Usunąć na zawsze?",
|
|
206
|
+
"ui.consent.delete.sources": "Najpierw zostaną usunięte źródła z nich: {list} – ich cytaty znikną z danych (wartości zostają); można je przywrócić, bez pliku (strom source restore).",
|
|
206
207
|
"ui.consent.delete.no": "Nic nie usunięto.",
|
|
208
|
+
"ui.consent.retract": "Wycofać w badaniu {list}: z danych zniknie {cites, plural, one {# cytowanie} few {# cytowania} many {# cytowań} other {# cytowania}} (wartości zostają; mniej pewnych danych: {lowered}), {stories, plural, one {# opowieść} few {# opowieści} many {# opowieści} other {# opowieści}} przestanie podawać źródło. Później można przywrócić (strom source restore). Wycofać?",
|
|
209
|
+
"ui.source.retract.would": "Wycofane zostałoby źródło {name} [{id}]: {cites, plural, one {# cytowanie} few {# cytowania} many {# cytowań} other {# cytowania}}, {stories, plural, one {# opowieść} few {# opowieści} many {# opowieści} other {# opowieści}}; bez źródła zostanie: {bare}; mniej pewne: {lowered}; zadania: {tasks}; sprzeczności do sprawdzenia: {conflicts}. Nic nie zapisano.",
|
|
210
|
+
"ui.source.restore.skipped": "{n, plural, one {# cytowanie nie wróciło} few {# cytowania nie wróciły} many {# cytowań nie wróciło} other {# cytowania nie wróciło}} (danej już nie ma albo już cytuje źródło)",
|
|
207
211
|
"ui.views.estimate": "{n, plural, one {# skan} few {# skany} many {# skanów} other {# skanów}} z {books, plural, one {# księgi} few {# ksiąg} many {# ksiąg} other {# ksiąg}}, odczyty: {readers}, w rozmiarach {sizes} px, ok. {cost} – uruchamia człowiek: strom media calibrate",
|
|
208
212
|
"ui.views.offer": "odczyt skanów był dostrojony dla {before}, dla {now} jeszcze nie: strom media calibrate (uruchamia człowiek; płatna praca modelu)",
|
|
209
213
|
"ui.views.progress": "▶ {what} · {size} px · skany: {n}",
|
|
@@ -258,6 +262,15 @@
|
|
|
258
262
|
"ui.tune.q.c.keep": "Zachowaj",
|
|
259
263
|
"ui.o.tune": "{n, plural, one {# pytanie o ich odczyt czeka} few {# pytania o ich odczyt czekają} many {# pytań o ich odczyt czeka} other {# pytań o ich odczyt czeka}} na decyzję człowieka: strom media calibrate --questions",
|
|
260
264
|
"ui.waiting.tune": "Pytanie o odczyt skanów: {text}",
|
|
265
|
+
"ui.waiting.aside.same": "{file}: zapisany jako skan {image} księgi {book}, ten sam skan co {media} pod innym numerem – jeden z dwóch numerów jest błędny",
|
|
266
|
+
"ui.waiting.aside.other": "{file}: inny skan niż skan {image} księgi {book} ({media}) – który z nich jest skanem {image}?",
|
|
267
|
+
"ui.wait.kind.aside": "zapisany skan",
|
|
268
|
+
"ui.aside.compare": "Otworzyć oba do porównania",
|
|
269
|
+
"ui.aside.keep": "Skan {image} zostaje bez zmian (plik do kosza)",
|
|
270
|
+
"ui.aside.take": "Nowy plik jest skanem {image} (dotychczasowy wycofany, zachowany)",
|
|
271
|
+
"ui.aside.number": "Nowy plik to inny skan księgi: jego numer",
|
|
272
|
+
"ui.aside.number.ask": "Numer skanu:",
|
|
273
|
+
"ui.aside.discard": "Plik do kosza (który numer jest właściwy, wyjaśni badanie)",
|
|
261
274
|
"ui.tune.title": "Odczyt skanów · {agent} · {days, plural, one {# dzień} few {# dni} many {# dni} other {# dni}} od {since} – z własnych zapisów badania, za darmo",
|
|
262
275
|
"ui.tune.none": "Odczyt skanów · {agent}: jeszcze nic nie zmierzono – liczby przynoszą sesje strom run i czytelnicy strom read.",
|
|
263
276
|
"ui.tune.noscans": "Odczyt skanów · {agent}: tutaj jeszcze żadnych odczytanych skanów (sesje {sessions}).",
|
|
@@ -919,6 +932,7 @@
|
|
|
919
932
|
"waiting.held": "odłożone: badanie czeka na swojego agenta, którego nie ma na tym komputerze; wróci do kolejki, gdy agent tu będzie",
|
|
920
933
|
"archive.removed": "usunięte w aplikacji Strom",
|
|
921
934
|
"archive.wait": "Decyzja o pobieraniu z archiwum {title}",
|
|
935
|
+
"audit.wait.images": "Skany {images} z księgi {book}",
|
|
922
936
|
"history.why.archive": "Dopóki badanie jest prowadzone jako archiwum, nic nie jest wyszukiwane.",
|
|
923
937
|
"history.why.held": "Wydarzeń regionu {region} szuka inne badanie na tym komputerze.",
|
|
924
938
|
"history.why.nobody": "W tych latach nikt z drzewa tu nie mieszkał.",
|
|
@@ -1511,6 +1525,7 @@
|
|
|
1511
1525
|
"ui.help.cmd.offline.set": "Jak jest badana jedna gałąź poza liniami: własny wybór, dodana do linii albo jak w całym drzewie",
|
|
1512
1526
|
"ui.help.cmd.offline.answer": "Odpowiedzieć na propozycję dla gałęzi, która urosła: dodać do linii, zostawić albo nie badać",
|
|
1513
1527
|
"ui.help.cmd.conflict.leave": "Zostawić sprzeczność ze zmiany w aplikacji Strom do rozstrzygnięcia agentowi",
|
|
1528
|
+
"ui.help.cmd.conflict.keep": "Zachować rozstrzygnięcie, choć źródło, na którym się opierało, wycofano: zdjąć znacznik do sprawdzenia",
|
|
1514
1529
|
"ui.help.cmd.event.main": "Wybrać zapis pokazywany przy danej jako pierwszy (główny przypis) albo cofnąć wybór",
|
|
1515
1530
|
"ui.help.cmd.event.revert":"Przywrócić daną, jak podawało ją przejęte drzewo",
|
|
1516
1531
|
"ui.help.cmd.person.revert": "Przywrócić imię i nazwisko lub płeć, jak podawało je przejęte drzewo",
|
|
@@ -1534,6 +1549,8 @@
|
|
|
1534
1549
|
"ui.help.cmd.place.answer": "Odpowiedzieć na pytanie badania o miejsce",
|
|
1535
1550
|
"ui.help.cmd.place.undo": "Cofnąć krok dotyczący miejsc: odpowiedź, usuniętą nazwę",
|
|
1536
1551
|
"ui.help.cmd.source.split": "Rozdzielić miejsce wpisów starszych źródeł na folio i obraz: podgląd, potem jeden krok, który można cofnąć",
|
|
1552
|
+
"ui.help.cmd.source.retract": "Wycofać źródło w badaniu: jego cytowania zostają w nim zachowane, najpierw podgląd, później można przywrócić",
|
|
1553
|
+
"ui.help.cmd.source.restore": "Przywrócić wycofane źródło wraz z jego cytowaniami (wycofane źródła pokazuje strom source list --retracted)",
|
|
1537
1554
|
"ui.help.cmd.hypothesis.decide": "Rozstrzygnąć niepewne połączenie (hipotezę) jednym z wariantów, z uzasadnieniem",
|
|
1538
1555
|
"ui.help.cmd.connector.add": "Zainstalować program pobierający dla archiwum z folderu lub adresu git",
|
|
1539
1556
|
"ui.help.cmd.connector.remove": "Usunąć program pobierający dla archiwum wraz z jego zgodą",
|
|
@@ -1897,6 +1914,10 @@
|
|
|
1897
1914
|
"ui.sync.do.uncite.kept": "nie zapisano: o tym, czego dana już nie cytuje, decyduje tylko użytkownik",
|
|
1898
1915
|
"ui.sync.do.cite.olderApp": "nic się nie zmienia: ta aplikacja Strom nie zgłasza usunięcia cytatu – badanie go zachowuje",
|
|
1899
1916
|
"ui.sync.do.cite.sourceRemoved": "nic się nie zmienia: badanie zachowuje źródło i jego cytaty",
|
|
1917
|
+
"ui.sync.source.retract": "{n}. usunięte w aplikacji Strom: {sources}",
|
|
1918
|
+
"ui.sync.do.source.retract": "usunięte także w badaniu, jego cytaty w nim zachowane (strom source restore je przywraca)",
|
|
1919
|
+
"ui.sync.do.source.retract-skipped": "nic nie jest usuwane: badanie zachowuje źródło",
|
|
1920
|
+
"ui.sync.do.source.retracted": "nie zapisano: źródło zostało usunięte",
|
|
1900
1921
|
"ui.sync.do.cite.notCarried": "nic się nie zmienia: badanie zachowuje cytat",
|
|
1901
1922
|
"ui.sync.do.fact.noMatch": "nie zapisano: danej, przy której go wybrano, badanie tak nie ma",
|
|
1902
1923
|
"ui.sync.do.event.retracted": "nie zapisano: badanie w międzyczasie wycofało tę daną (nie wróci już do aplikacji)",
|
|
@@ -2178,6 +2199,13 @@
|
|
|
2178
2199
|
"ui.phone.page.lines.off": "Tego drzewa teraz nikt nie bada: linie zostają, jak są.",
|
|
2179
2200
|
"ui.settings.phone": "Połączenie z telefonem (zdjęcia z telefonu do badania w sieci lokalnej): {state}",
|
|
2180
2201
|
"ui.settings.hypotheses": "Kto rozstrzyga hipotezy: {state}",
|
|
2202
|
+
"ui.settings.runconfirm": "Uruchamianie agenta z aplikacji Strom: {state}",
|
|
2203
|
+
"ui.runconfirm.ask": "z potwierdzeniem",
|
|
2204
|
+
"ui.runconfirm.no": "bez potwierdzenia",
|
|
2205
|
+
"ui.runconfirm.pick": "Uruchamianie agenta z aplikacji Strom (rozmowa, zadanie, praca nad kolejką, ustalanie miejsc) – w ramach subskrypcji lub kredytu AI:",
|
|
2206
|
+
"ui.runconfirm.choice.ask": "Pytać przed uruchomieniem (domyślnie)",
|
|
2207
|
+
"ui.runconfirm.choice.no": "Uruchamiać bez potwierdzenia",
|
|
2208
|
+
"ui.runconfirm.about": "Bez potwierdzenia to, o co prosi aplikacja Strom, uruchamia się od razu, a w terminalu mówi o tym jedna linia. Nadal pytane są: pytanie z ceną w pieniądzach, zgody archiwów, usuwanie, wysłanie prośby i warunek samodzielnej pracy. Dotyczy wszystkich badań na tym komputerze.",
|
|
2181
2209
|
"ui.settings.phone.on": "włączone, sparowane telefony: {n}",
|
|
2182
2210
|
"ui.settings.phone.error": "włączone, niedostępne",
|
|
2183
2211
|
"ui.phone.menu.off": "Wyłącz połączenie z telefonem (sparowane telefony pozostaną sparowane)",
|
|
@@ -2372,6 +2400,7 @@
|
|
|
2372
2400
|
"ui.run.loop": "Pozwól mu pracować, dopóki jest co robić i pozwala na to warunek „{name}”",
|
|
2373
2401
|
"ui.consent.gate.set": "Pozwolić warunkowi „{name}” decydować, kiedy agent pracujący samodzielnie kontynuuje?",
|
|
2374
2402
|
"ui.consent.gate.unset": "Usunąć warunek „{name}” – agent pracujący samodzielnie nie będzie go już pytał?",
|
|
2403
|
+
"ui.consent.run.confirm": "Uruchamiać agenta z odnośników aplikacji Strom bez pytania? Pracuje w ramach subskrypcji lub kredytu AI; pytania z ceną w pieniądzach, zgody i warunek samodzielnej pracy pozostają.",
|
|
2375
2404
|
"ui.consent.gate.skip": "Pozwolić agentowi pracować samodzielnie bez warunku „{name}”?",
|
|
2376
2405
|
"ui.run.browser.always": "· przeglądarka (Claude in Chrome) w każdej sesji, zgodnie z ustawieniem (agent.browser always) – bez pytania dla {hosts}; musi działać Chrome z rozszerzeniem Claude",
|
|
2377
2406
|
"ui.consent.browser": "Dać agentowi narzędzia przeglądarki (Claude in Chrome) w każdej sesji badania? Pracuje w Chrome na tym komputerze – także z jego zalogowaniami – na stronach archiwów badania bez pytania; w rozmowie o każdą inną stronę zapyta.",
|
|
@@ -2421,6 +2450,7 @@
|
|
|
2421
2450
|
"ui.link.noterminal.new": "strom nie mógł otworzyć okna terminala. Uruchomić {strom}, a potem spróbować ponownie z aplikacji Strom.",
|
|
2422
2451
|
"ui.link.asks": "Prośba z aplikacji Strom: {what}\nBadanie: {name}",
|
|
2423
2452
|
"ui.link.go": "Kontynuować?",
|
|
2453
|
+
"ui.link.noconfirm": "▶ Uruchamianie bez potwierdzenia (badanie {name}): {what}. Pytanie przed uruchomieniem agenta włącza się w Ustawieniach → 1 → „Uruchamianie agenta z aplikacji Strom”, albo strom config unset run.confirm.",
|
|
2424
2454
|
"ui.link.cost": "Agent pracuje w ramach subskrypcji lub kredytu AI swojego konta.",
|
|
2425
2455
|
"ui.link.tasks": "Badanie zapisze zadania dla agenta – teraz niczego się nie szuka i za nic się nie płaci.",
|
|
2426
2456
|
"ui.link.what.chat": "rozmowa z agentem ({agent}) o badaniu.",
|
|
@@ -2684,6 +2714,7 @@
|
|
|
2684
2714
|
"ui.input.delete.kept.sameAs": "{id}: plik zostaje na dysku – ten sam plik to {same}",
|
|
2685
2715
|
"ui.input.delete.kept.otherResearch": "{id}: plik zostaje na dysku – ten sam plik ma inne badanie na tym komputerze",
|
|
2686
2716
|
"ui.input.delete.source": "{source} bez swojego pliku {id} – tekst i cytowania zostają",
|
|
2717
|
+
"ui.input.delete.retracted": "{source} usunięte razem z plikiem – strom source restore je przywraca, bez pliku",
|
|
2687
2718
|
"ui.input.delete.images": "{source} bez {n, plural, one {# obrazu} few {# obrazów} many {# obrazów} other {# obrazu}} usuniętego pliku",
|
|
2688
2719
|
"ui.input.delete.task.without": "zadanie {task} – bez {files} (usunięto)",
|
|
2689
2720
|
"ui.input.delete.task.dropped": "zadanie {task} anulowano – jego pliki są usunięte ({files})",
|
|
@@ -2882,6 +2913,7 @@
|
|
|
2882
2913
|
"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)",
|
|
2883
2914
|
"wait.group.app": "Aplikacja Strom",
|
|
2884
2915
|
"wait.group.tune": "Odczyt skanów",
|
|
2916
|
+
"wait.group.aside": "Skany zapisane ręcznie",
|
|
2885
2917
|
"wait.group.conflicts": "Do rozstrzygnięcia – sprzeczności",
|
|
2886
2918
|
"wait.group.places": "Miejsca do identyfikacji",
|
|
2887
2919
|
"wait.group.branches": "Gałęzie poza liniami",
|
|
@@ -2927,6 +2959,10 @@
|
|
|
2927
2959
|
"log.person.restore": "Znów obowiązuje: {who}",
|
|
2928
2960
|
"log.family.retract": "Wycofana rodzina: {who}",
|
|
2929
2961
|
"log.source.retract": "Wycofany zapis: {name}",
|
|
2962
|
+
"log.source.deleted": "Źródło wycofane: {name} [{id}] – {cites, plural, one {# cytowanie} few {# cytowania} many {# cytowań} other {# cytowania}}, {stories, plural, one {# opowieść} few {# opowieści} many {# opowieści} other {# opowieści}}",
|
|
2963
|
+
"log.source.restored": "Źródło przywrócone: {name} [{id}] – {cites, plural, one {# cytowanie wróciło} few {# cytowania wróciły} many {# cytowań wróciło} other {# cytowania wróciło}}",
|
|
2964
|
+
"log.conflict.keep": "Rozstrzygnięcie obowiązuje także bez wycofanego źródła: {name}",
|
|
2965
|
+
"source.retracted.task": "źródło wycofane ({id})",
|
|
2930
2966
|
"log.place.retract": "Wycofane miejsce: {name}",
|
|
2931
2967
|
"log.repository.retract": "Wycofane archiwum: {name}",
|
|
2932
2968
|
"log.name.remove": "Usunięte imię i nazwisko: {name} – {who}",
|
|
@@ -3163,7 +3199,7 @@
|
|
|
3163
3199
|
"ui.sent.discarded.app": "Aplikacja Strom pokaże wysłanie jako odrzucone; zmiany zostają w niej i można je wysłać ponownie.",
|
|
3164
3200
|
"ui.trees.pack": "spakuj „{name}”, aby wysłać komuś (plik ZIP)",
|
|
3165
3201
|
"ui.trees.unpack": "drzewo genealogiczne, które ktoś przysłał (plik ZIP)",
|
|
3166
|
-
"ui.pack.which": "Które skany dołączyć?",
|
|
3202
|
+
"ui.pack.which": "Które skany z archiwów dołączyć? (rodzinne zdjęcia i oryginały zawsze wszystkie)",
|
|
3167
3203
|
"ui.pack.opt.records": "tylko z aktami – {size} (przeszukane strony archiwum udostępni ponownie)",
|
|
3168
3204
|
"ui.pack.opt.all": "wszystkie – {size}",
|
|
3169
3205
|
"ui.pack.done": "Spakowano „{name}”: {file} ({size})",
|
|
@@ -3172,10 +3208,10 @@
|
|
|
3172
3208
|
"ui.pack.images.all": " skany z archiwów: wszystkie {n} ({size})",
|
|
3173
3209
|
"ui.pack.family": " rodzinne zdjęcia i oryginały: {n} ({size}) – wszystkie, nikt ich nie pobierze ponownie",
|
|
3174
3210
|
"ui.pack.batches": " partie z aplikacji Strom: {n} (nazwa, osoby, notatka)",
|
|
3175
|
-
"ui.pack.left": " pominięte: {n, plural, one {# skan} few {# skany} many {# skanów} other {# skanów}} ({size}) – przeszukane strony; gdy będą potrzebne, strom pobierze je z archiwum ponownie",
|
|
3211
|
+
"ui.pack.left": " pominięte: {n, plural, one {# skan} few {# skany} many {# skanów} other {# skanów}} z archiwów ({size}) – przeszukane strony; gdy będą potrzebne, strom pobierze je z archiwum ponownie",
|
|
3176
3212
|
"ui.pack.connectors": " konektory: {list}",
|
|
3177
3213
|
"ui.pack.noconnector": "⚠ niektóre pominięte skany przyszły przez konektor, którego nie ma na tym komputerze – nikt nie pobrałby ich ponownie: strom pack --all-images",
|
|
3178
|
-
"ui.pack.missing": "⚠ skany, które wymienia drzewo genealogiczne, a których nie ma na tym komputerze: {n} – brak ich w paczce",
|
|
3214
|
+
"ui.pack.missing": "⚠ skany z archiwów, które wymienia drzewo genealogiczne, a których nie ma na tym komputerze: {n} – brak ich w paczce",
|
|
3179
3215
|
"ui.pack.send": "Wystarczy wysłać plik. Odbiorca go rozpakuje i dwukrotnym kliknięciem uruchomi Windows.cmd lub macOS.command w środku: strom zostanie zainstalowany, jeśli go brakuje, a badanie się otworzy (kto już ma strom: strom unpack \"<plik>\").",
|
|
3180
3216
|
"ui.pack.readme.file": "JAK-KONTYNUOWAC.txt",
|
|
3181
3217
|
"ui.pack.readme": "Badanie „{name}” – jak je kontynuować\n=====================================\n\n1. Rozpakować cały plik ZIP: w systemie Windows prawym przyciskiem – Wyodrębnij wszystkie; na Macu dwukrotnym kliknięciem.\n\n2. W rozpakowanym folderze uruchomić dwukrotnym kliknięciem:\n Windows: Windows.cmd\n macOS: macOS.command (za pierwszym razem prawym przyciskiem – Otwórz; gdy macOS na to nie pozwala:\n Ustawienia systemowe – Prywatność i ochrona – Otwórz mimo to)\n Linux: w terminalu: bash Linux.sh\n Zainstaluje Strom Research, jeśli go jeszcze nie ma (oficjalnym instalatorem), umieści badanie\n na miejscu – drzewo genealogiczne wśród pozostałych, skany w folderze współdzielonym, wszystko sprawdzi –,\n przejmie je na ten komputer i otworzy strom.\n\n3. Dalej: w menu strom rozmowa z agentem.\n\nBez plików startowych: zainstalować strom ręcznie\n Windows (PowerShell): {win}\n macOS, Linux (Terminal): {unix}\npotem: strom unpack \"<ten plik ZIP>\" (wpisać strom unpack i spację, przeciągnąć plik\ndo terminala, Enter) – albo w menu strom: inne drzewo genealogiczne – drzewo genealogiczne, które ktoś przysłał.\n\nSkany, na których są akty, oraz rodzinne zdjęcia i oryginały są w paczce. Pozostałych stron ksiąg (przeszukanych,\nnic na nich nie znaleziono) ze względu na rozmiar nie ma – gdy będą potrzebne, strom pobierze je\nz archiwum ponownie.\n",
|
|
@@ -3205,7 +3241,7 @@
|
|
|
3205
3241
|
"ui.remove.person": "drzewo genealogiczne z komputera usuwa tylko człowiek przy komputerze",
|
|
3206
3242
|
"ui.remove.busy": "nad drzewem genealogicznym „{name}” właśnie trwa praca – usunąć je można, gdy praca się zakończy",
|
|
3207
3243
|
"ui.remove.what": "„{name}” ({root}) · osoby: {persons}",
|
|
3208
|
-
"ui.remove.backup": "Najpierw spakować je jako kopię zapasową, ze wszystkimi skanami ({size})? W każdej chwili można je przywrócić przez strom unpack.",
|
|
3244
|
+
"ui.remove.backup": "Najpierw spakować je jako kopię zapasową, ze wszystkimi skanami z archiwów, rodzinnymi zdjęciami i oryginałami ({size})? W każdej chwili można je przywrócić przez strom unpack.",
|
|
3209
3245
|
"ui.remove.backup.done": " kopia zapasowa: {file}",
|
|
3210
3246
|
"ui.remove.images": "Przenieść do kosza także skany z archiwów, których nie używa żadne inne drzewo genealogiczne (skany: {n}, {size})?",
|
|
3211
3247
|
"ui.remove.family": "Przenieść do kosza także rodzinne zdjęcia i oryginały, których nie używa żadne inne drzewo genealogiczne ({n}, {size})? Nikt ich nie pobierze ponownie.",
|
|
@@ -3766,6 +3802,11 @@
|
|
|
3766
3802
|
"ui.link.work.gate.once": "Warunek: {gate} – pytany raz, przed pierwszą sesją; gdyby nie pozwolił zacząć, pytanie pojawi się tutaj.",
|
|
3767
3803
|
"ui.link.work.gate.none": "Warunek: brak (ustawienie run.gate).",
|
|
3768
3804
|
"ui.link.work.empty": "W kolejce nic nie czeka. Nic nie uruchomiono.",
|
|
3805
|
+
"ui.link.what.work.picked": "samodzielna praca agenta nad zadaniami z aplikacji Strom, zadań: {n}",
|
|
3806
|
+
"ui.link.work.picked.head": "Te zadania, w tej kolejności:",
|
|
3807
|
+
"ui.link.work.picked": "Jedna sesja na zadanie ({n, plural, one {# sesja} few {# sesje} many {# sesji} other {# sesji}}), potem koniec; co nie zostanie skończone, wraca do kolejki.",
|
|
3808
|
+
"ui.link.work.picked.gone": "Zadania z odnośnika, które już nie czekają (zrobione, cofnięte lub zajęte przez innego), pominięte: {n}.",
|
|
3809
|
+
"ui.link.work.picked.none": "Żadne z zadań odnośnika już nie czeka. Nic nie zostało uruchomione.",
|
|
3769
3810
|
"ui.link.work.busy": "Nad tym badaniem już trwa praca (przebiegi: {runs}, sesje: {sessions}). Nic więcej nie uruchomiono.",
|
|
3770
3811
|
"ui.link.work.nogate": "Praca automatyczna działa tylko pod warunkiem (ustawienie run.gate): przed każdą sesją mówi, czy kontynuować, czekać, czy skończyć. Bez niego nic nie uruchomi się samo.",
|
|
3771
3812
|
"ui.link.work.instead": "Zamiast tego:",
|
|
@@ -4241,6 +4282,7 @@
|
|
|
4241
4282
|
"ui.verify.bulk.queued": "{people, plural, one {# osoba} few {# osoby} many {# osób} other {# osób}}, {facts, plural, one {# dana} few {# dane} many {# danych} other {# danych}} do sprawdzenia z oryginałami – po pracy nad liniami, od czasu do czasu jedna wcześniej",
|
|
4242
4283
|
"ui.verify.bulk.would": "Do sprawdzenia z oryginałami: {people, plural, one {# osoba} few {# osoby} many {# osób} other {# osób}}, {facts, plural, one {# dana} few {# dane} many {# danych} other {# danych}} (nic jeszcze nie zapisano)",
|
|
4243
4284
|
"ui.verify.bulk.search": "w tym {n, plural, one {# dana} few {# dane} many {# danych} other {# danych}} z zaimportowanego drzewa bez odczytanego oryginału: najpierw poszukiwanie aktu (drożej)",
|
|
4285
|
+
"ui.verify.bulk.first": "{people, plural, one {# osoba} few {# osoby} many {# osób} other {# osób}}, {facts, plural, one {# dana} few {# dane} many {# danych} other {# danych}} do sprawdzenia z oryginałami – próba, na początku kolejki: weźmie ją następna sesja",
|
|
4244
4286
|
"ui.verify.bulk.left": "{n, plural, one {# kolejna osoba} few {# kolejne osoby} many {# kolejnych osób} other {# kolejnych osób}} z zakresu na później",
|
|
4245
4287
|
"ui.verify.confirmed": "{fact} potwierdzone według skanu.",
|
|
4246
4288
|
"ui.verify.unconfirmed": "{fact}: potwierdzenie według skanu cofnięte.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// A strom gate (interface 1): let the research work alone while the Claude
|
|
2
|
-
// subscription has room. It asks Claude Code itself
|
|
3
|
-
//
|
|
2
|
+
// subscription has room. It asks Claude Code itself for the plan's limits as
|
|
3
|
+
// the server reports them (see "Two ways to ask" below) and answers strom:
|
|
4
4
|
// exit 0 go on exit 1 wait (JSON "until": when to ask again)
|
|
5
5
|
// exit 2 stop the run — one line of JSON on stdout says why.
|
|
6
6
|
//
|
|
@@ -34,7 +34,17 @@
|
|
|
34
34
|
// session of every run, and no "start anyway" goes past it; a session at work
|
|
35
35
|
// is asked to finish when the week reaches 99 %. What the agent said of its
|
|
36
36
|
// limits in this run (STROM_AGENT_LIMITS, at most 15 minutes old) is read
|
|
37
|
-
// instead of asking
|
|
37
|
+
// instead of asking Claude Code.
|
|
38
|
+
//
|
|
39
|
+
// Two ways to ask. First the SDK's control request get_usage with
|
|
40
|
+
// skip_behaviors (one line of JSON on stdin of `claude -p --input-format
|
|
41
|
+
// stream-json`): the plan's limits alone, in a second or two, no model called.
|
|
42
|
+
// `claude -p /usage` adds to them, always, what contributed to the usage — read
|
|
43
|
+
// from every conversation kept on the computer in the last 7 days, which took
|
|
44
|
+
// over a minute on a busy computer (2026-11-03: 75 s). When get_usage is not
|
|
45
|
+
// read (an older Claude Code that does not know it, an error, no answer in
|
|
46
|
+
// GET_MS, no week's limit in it, no limits at all: an API key or no login),
|
|
47
|
+
// `claude -p /usage` is asked as before; it also says which of the two it is.
|
|
38
48
|
//
|
|
39
49
|
// What `claude -p /usage` says is not always read: an answer without the
|
|
40
50
|
// week's line, an exit status, no answer in time. It asks again (ATTEMPTS, a
|
|
@@ -49,7 +59,7 @@ import fs from "node:fs";
|
|
|
49
59
|
import { spawnSync } from "node:child_process";
|
|
50
60
|
|
|
51
61
|
const DAY = 86_400_000;
|
|
52
|
-
/** What the agent said of its limits counts for this long; older:
|
|
62
|
+
/** What the agent said of its limits counts for this long; older: Claude Code is asked. */
|
|
53
63
|
const FRESH_MS = 15 * 60_000;
|
|
54
64
|
/** Under a cap, a session at work is asked to finish at the cap — at most at this much of the week. */
|
|
55
65
|
const FINISH_AT = 0.99;
|
|
@@ -79,6 +89,13 @@ const lang = (process.env.STROM_LANG ?? "en").slice(0, 2);
|
|
|
79
89
|
*/
|
|
80
90
|
const ATTEMPTS = 3;
|
|
81
91
|
const ASK_MS = 180_000;
|
|
92
|
+
/**
|
|
93
|
+
* get_usage answers in a second or two; past this `claude -p /usage` is asked, with the rest of BUDGET_MS (tests give a
|
|
94
|
+
* shorter one: CLAUDE_USAGE_GET_MS).
|
|
95
|
+
*/
|
|
96
|
+
const GET_MS = /^\d+$/.test(process.env.CLAUDE_USAGE_GET_MS ?? "") ? Number(process.env.CLAUDE_USAGE_GET_MS) : 30_000;
|
|
97
|
+
/** The id of the gate's control request, found again in Claude Code's answer. */
|
|
98
|
+
const REQUEST_ID = "strom-gate-usage";
|
|
82
99
|
/** The pause between two askings (tests give a shorter one: CLAUDE_USAGE_RETRY_MS). */
|
|
83
100
|
const RETRY_MS = /^\d+$/.test(process.env.CLAUDE_USAGE_RETRY_MS ?? "") ? Number(process.env.CLAUDE_USAGE_RETRY_MS) : 30_000;
|
|
84
101
|
/** All the askings within this, inside the gate's timeout (gate.json: 660 s). */
|
|
@@ -245,11 +262,11 @@ let session: Use | undefined;
|
|
|
245
262
|
let week: Use | undefined;
|
|
246
263
|
|
|
247
264
|
// ── what the agent said in this run, when it is fresh ───────────────────────
|
|
248
|
-
const
|
|
265
|
+
const began = Date.now();
|
|
266
|
+
const said = fromAgent(process.env.STROM_AGENT_LIMITS) ?? getUsage(GET_MS);
|
|
249
267
|
if (said) ({ session, week } = said);
|
|
250
268
|
else {
|
|
251
|
-
// ── what
|
|
252
|
-
const began = Date.now();
|
|
269
|
+
// ── what `claude -p /usage` says: asked again when it cannot be read, then a wait — never a stop for one answer ─
|
|
253
270
|
let detail = "";
|
|
254
271
|
let tries = 0;
|
|
255
272
|
for (;;) {
|
|
@@ -273,19 +290,19 @@ else {
|
|
|
273
290
|
if (tries >= ATTEMPTS || BUDGET_MS - (Date.now() - began) < RETRY_MS + ASK_MS / 2) break;
|
|
274
291
|
sleep(RETRY_MS);
|
|
275
292
|
}
|
|
276
|
-
if (!week) answer(1, say("unreadWait", { tries, detail, min: UNREAD_WAIT / 60_000 }), new Date(
|
|
293
|
+
if (!week) answer(1, say("unreadWait", { tries, detail, min: UNREAD_WAIT / 60_000 }), new Date(nowMs() + UNREAD_WAIT));
|
|
277
294
|
}
|
|
278
295
|
if (!week) answer(2, say("unread", { detail: say("noweek") }));
|
|
279
296
|
// the week's line without its reset: nothing used yet goes (a new week), else what it says is not read
|
|
280
297
|
if (!week.resets) {
|
|
281
298
|
if (week.used === 0) answer(0, say("unused"));
|
|
282
|
-
answer(1, say("unreadWait", { tries: 1, detail: say("noweek"), min: UNREAD_WAIT / 60_000 }), new Date(
|
|
299
|
+
answer(1, say("unreadWait", { tries: 1, detail: say("noweek"), min: UNREAD_WAIT / 60_000 }), new Date(nowMs() + UNREAD_WAIT));
|
|
283
300
|
}
|
|
284
301
|
// the cap first: the user's own hard stop, whatever the pace
|
|
285
302
|
if (cap !== undefined && week.used >= cap)
|
|
286
303
|
answer(2, say("cap", { used: Math.floor(week.used), cap, resets: week.resets.toLocaleString(lang, { weekday: "short", day: "numeric", month: "numeric", hour: "2-digit", minute: "2-digit" }) }), undefined, true);
|
|
287
304
|
|
|
288
|
-
const now =
|
|
305
|
+
const now = nowMs();
|
|
289
306
|
const resets = week.resets.getTime();
|
|
290
307
|
const start = resets - WEEK;
|
|
291
308
|
const gone = Math.max(0, Math.min(100, ((now - start) / WEEK) * 100));
|
|
@@ -337,6 +354,52 @@ const tail =
|
|
|
337
354
|
// a wait counts the reserve: once it waited it goes again only with the reserve more
|
|
338
355
|
answer(1, head(false, true) + tail, new Date(Math.max(at, now + 5 * 60_000)));
|
|
339
356
|
|
|
357
|
+
/**
|
|
358
|
+
* The plan's limits by the control request get_usage (skip_behaviors: the limits alone, nothing read of the
|
|
359
|
+
* conversations kept on the computer), or nothing — then `claude -p /usage` is asked, which also tells an API key and
|
|
360
|
+
* a Claude Code not logged in (get_usage says only that there are no limits) and says why it was not read.
|
|
361
|
+
*/
|
|
362
|
+
function getUsage(timeout: number): { session?: Use; week: Use } | undefined {
|
|
363
|
+
const request = { type: "control_request", request_id: REQUEST_ID, request: { subtype: "get_usage", skip_behaviors: true } };
|
|
364
|
+
const r = spawnSync("claude", ["-p", "--input-format", "stream-json", "--output-format", "stream-json", "--verbose"], {
|
|
365
|
+
encoding: "utf8",
|
|
366
|
+
input: JSON.stringify(request) + "\n",
|
|
367
|
+
timeout: Math.max(100, timeout),
|
|
368
|
+
shell: process.platform === "win32",
|
|
369
|
+
windowsHide: true,
|
|
370
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
371
|
+
});
|
|
372
|
+
if (r.error || r.status !== 0) return undefined;
|
|
373
|
+
for (const raw of (r.stdout ?? "").split(/\r?\n/)) {
|
|
374
|
+
if (!raw.includes(REQUEST_ID)) continue;
|
|
375
|
+
let line: unknown;
|
|
376
|
+
try {
|
|
377
|
+
line = JSON.parse(raw);
|
|
378
|
+
} catch {
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
const res = (line as { type?: unknown; response?: { subtype?: unknown; request_id?: unknown; response?: unknown } })?.response;
|
|
382
|
+
if ((line as { type?: unknown }).type !== "control_response" || res?.request_id !== REQUEST_ID) continue;
|
|
383
|
+
// an older Claude Code: "Unsupported control request subtype"
|
|
384
|
+
if (res.subtype !== "success") return undefined;
|
|
385
|
+
const said = res.response as { rate_limits_available?: unknown; rate_limits?: Record<string, unknown> | null } | undefined;
|
|
386
|
+
if (said?.rate_limits_available !== true || !said.rate_limits) return undefined;
|
|
387
|
+
// utilization 0–100, resets_at an ISO moment (none: a window not begun)
|
|
388
|
+
const of = (kind: string): Use | undefined => {
|
|
389
|
+
const l = said.rate_limits![kind] as { utilization?: unknown; resets_at?: unknown } | null | undefined;
|
|
390
|
+
if (!l || typeof l.utilization !== "number" || !Number.isFinite(l.utilization)) return undefined;
|
|
391
|
+
const at = typeof l.resets_at === "string" ? new Date(l.resets_at) : undefined;
|
|
392
|
+
return { used: l.utilization, ...(at && !Number.isNaN(at.getTime()) ? { resets: at } : {}) };
|
|
393
|
+
};
|
|
394
|
+
const week = of("seven_day");
|
|
395
|
+
// as from /usage: the week's line without its reset is read only when nothing is used yet
|
|
396
|
+
if (!week || (!week.resets && week.used !== 0)) return undefined;
|
|
397
|
+
const session = of("five_hour");
|
|
398
|
+
return { week, ...(session ? { session } : {}) };
|
|
399
|
+
}
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
|
|
340
403
|
/**
|
|
341
404
|
* `claude -p /usage` once: the session's and the week's use, an API key's answer, or why it was not read — with the
|
|
342
405
|
* first line it said (shortened, no e-mail address), so the gate's log says what Claude Code answered.
|
|
@@ -385,6 +448,20 @@ function loggedIn(): boolean | undefined {
|
|
|
385
448
|
}
|
|
386
449
|
}
|
|
387
450
|
|
|
451
|
+
/**
|
|
452
|
+
* What time it is now: the computer's clock. A test fixes it (STROM_GATE_NOW: an ISO moment or epoch milliseconds), so
|
|
453
|
+
* the week gone, the resets and the waits it answers are exact; strom never sets it. How long an asking takes is
|
|
454
|
+
* measured on the computer's clock always.
|
|
455
|
+
*/
|
|
456
|
+
function nowMs(): number {
|
|
457
|
+
const fixed = process.env.STROM_GATE_NOW;
|
|
458
|
+
if (fixed) {
|
|
459
|
+
const at = /^\d+$/.test(fixed) ? Number(fixed) : Date.parse(fixed);
|
|
460
|
+
if (Number.isFinite(at)) return at;
|
|
461
|
+
}
|
|
462
|
+
return Date.now();
|
|
463
|
+
}
|
|
464
|
+
|
|
388
465
|
/** Waits here (the gate is one short program: nothing else to do meanwhile). */
|
|
389
466
|
function sleep(ms: number): void {
|
|
390
467
|
if (ms > 0) Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
@@ -406,7 +483,7 @@ function hold(resets: number | undefined): void {
|
|
|
406
483
|
if (!HOLD) return;
|
|
407
484
|
try {
|
|
408
485
|
if (resets === undefined) fs.rmSync(HOLD, { force: true });
|
|
409
|
-
else fs.writeFileSync(HOLD, JSON.stringify({ week: new Date(resets).toISOString(), since: new Date().toISOString() }) + "\n");
|
|
486
|
+
else fs.writeFileSync(HOLD, JSON.stringify({ week: new Date(resets).toISOString(), since: new Date(nowMs()).toISOString() }) + "\n");
|
|
410
487
|
} catch {
|
|
411
488
|
// a folder it may not write here: it asks as if for the first time
|
|
412
489
|
}
|
|
@@ -437,7 +514,7 @@ function fromAgent(json: string | undefined): { session?: Use; week: Use } | und
|
|
|
437
514
|
if (!l || typeof l.used !== "number" || !Number.isFinite(l.used) || typeof l.at !== "string") return undefined;
|
|
438
515
|
const at = Date.parse(l.at);
|
|
439
516
|
const resets = typeof l.resetsAt === "string" ? new Date(l.resetsAt) : undefined;
|
|
440
|
-
if (Number.isNaN(at) ||
|
|
517
|
+
if (Number.isNaN(at) || nowMs() - at > FRESH_MS || !resets || Number.isNaN(resets.getTime()) || resets.getTime() <= nowMs()) return undefined;
|
|
441
518
|
return { used: l.used * 100, resets };
|
|
442
519
|
};
|
|
443
520
|
const week = of("seven_day");
|
|
@@ -461,20 +538,21 @@ function resetAt(s: string): Date | undefined {
|
|
|
461
538
|
const zone = m[6]!;
|
|
462
539
|
if (!m[1]) {
|
|
463
540
|
// a time alone: today's in the zone, else tomorrow's
|
|
464
|
-
const [y, mo, d] = new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(new Date()).split("-").map(Number) as [number, number, number];
|
|
541
|
+
const [y, mo, d] = new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(new Date(nowMs())).split("-").map(Number) as [number, number, number];
|
|
465
542
|
for (const add of [0, 1]) {
|
|
466
543
|
const guess = Date.UTC(y, mo - 1, d + add, hour, minute);
|
|
467
544
|
const at = guess - offsetMs(guess, zone);
|
|
468
|
-
if (at >
|
|
545
|
+
if (at > nowMs()) return new Date(at);
|
|
469
546
|
}
|
|
470
547
|
return undefined;
|
|
471
548
|
}
|
|
472
549
|
const month = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"].indexOf(m[1].toLowerCase());
|
|
473
550
|
if (month < 0) return undefined;
|
|
474
|
-
|
|
551
|
+
const thisYear = new Date(nowMs()).getUTCFullYear();
|
|
552
|
+
for (const year of [thisYear, thisYear + 1]) {
|
|
475
553
|
const guess = Date.UTC(year, month, Number(m[2]), hour, minute);
|
|
476
554
|
const at = guess - offsetMs(guess, zone);
|
|
477
|
-
if (at >
|
|
555
|
+
if (at > nowMs() - DAY) return new Date(at);
|
|
478
556
|
}
|
|
479
557
|
return undefined;
|
|
480
558
|
}
|
package/dist/cli/help.js
CHANGED
|
@@ -237,12 +237,12 @@ export const HUMAN_COMMANDS = [
|
|
|
237
237
|
"menu", "status", "setup", "doctor", "error", "update", "uninstall", "shortcut",
|
|
238
238
|
"init", "trees", "trees use", "trees remove", "trees forget", "lang", "mode",
|
|
239
239
|
"chat", "run", "session finish", "research new", "research pause", "research resume", "research done", "research edit", "research order", "research move", "review", "verify bulk", "verify stop",
|
|
240
|
-
"intake", "sync", "sync undo", "sync discard", "sync note", "conflict list", "conflict resolve", "conflict leave", "event main", "event revert", "person revert", "hypothesis decide", "task list", "task wake", "task order", "story approve", "story discard",
|
|
240
|
+
"intake", "sync", "sync undo", "sync discard", "sync note", "conflict list", "conflict resolve", "conflict leave", "conflict keep", "event main", "event revert", "person revert", "hypothesis decide", "task list", "task wake", "task order", "story approve", "story discard",
|
|
241
241
|
"offline list", "offline show", "offline set", "offline answer",
|
|
242
242
|
"stats", "recent", "plan", "history", "history back", "person card", "person list", "pedigree", "find", "query", "doc",
|
|
243
243
|
"app", "app install", "live", "live start", "live stop", "phone", "phone on", "phone qr", "phone off", "export gedcom", "pack", "unpack", "seal adopt", "seal accept", "repair undo", "backup", "tidy", "check",
|
|
244
244
|
"fixes", "fixes show", "fixes run", "fixes decline", "fixes reopen", "fixes undo", "fixes review", "media calibrate",
|
|
245
|
-
"surname accept", "surname reject", "surname group", "surname ungroup", "surname unreject", "occupation add", "occupation list", "occupation remove", "quality dismiss", "quality undo", "place answer", "place undo", "source split",
|
|
245
|
+
"surname accept", "surname reject", "surname group", "surname ungroup", "surname unreject", "occupation add", "occupation list", "occupation remove", "quality dismiss", "quality undo", "place answer", "place undo", "source split", "source retract", "source restore",
|
|
246
246
|
"config get", "config set", "login", "connector add", "connector remove", "connector use", "link on", "link off", "hook on", "hook off",
|
|
247
247
|
];
|
|
248
248
|
function humanOf(name, as) {
|
package/dist/cli/menu-links.js
CHANGED
|
@@ -44,6 +44,7 @@ import { normId } from "../core/records.js";
|
|
|
44
44
|
import { settledClaim } from "../core/labels.js";
|
|
45
45
|
import { sideOf, sideText, sidesOf } from "../core/conflicts.js";
|
|
46
46
|
import { PROFILES } from "../agents/profiles.js";
|
|
47
|
+
import { isAgent } from "../core/which.js";
|
|
47
48
|
import { foldText, safeFolderName } from "../core/text.js";
|
|
48
49
|
import { StromError } from "../core/errors.js";
|
|
49
50
|
import { forgetTree } from "../commands/trees.js";
|
|
@@ -72,6 +73,26 @@ export async function asks(ctx, lang, root, what, note, suggested = true) {
|
|
|
72
73
|
ctx.io.stdout(lines(translator(lang)("ui.link.asks", { what, name }), note, "") + "\n");
|
|
73
74
|
return ctx.confirm(translator(lang)("ui.link.go"), suggested);
|
|
74
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* What the Strom app asks that starts the agent on the subscription or AI credit (ui.link.cost): asked as `asks` does,
|
|
78
|
+
* or — the person's standing yes, run.confirm no (spec 123) — started at once with one line saying so and where the
|
|
79
|
+
* question is turned on again. Still asked: a question that says a price in money (`priced`), an agent's or a script's
|
|
80
|
+
* own command (only the person in their terminal), and all the rest (consents, deletions, the gate of strom run).
|
|
81
|
+
*/
|
|
82
|
+
export async function asksToStart(ctx, lang, root, what, note, suggested = true, priced = false) {
|
|
83
|
+
if (!startsUnasked(ctx, priced))
|
|
84
|
+
return asks(ctx, lang, root, what, note, suggested);
|
|
85
|
+
const name = Tree.open(root, ctx.env).config.name;
|
|
86
|
+
ctx.io.stdout(translator(lang)("ui.link.noconfirm", { what: what.trim().replace(/[.:]$/u, ""), name }) + "\n");
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Whether asksToStart starts without its question (run.confirm no, a person in their terminal, no price in money): what
|
|
91
|
+
* the link starts right after it is then not asked yes or no again — the line said it starts.
|
|
92
|
+
*/
|
|
93
|
+
export function startsUnasked(ctx, priced = false) {
|
|
94
|
+
return !priced && ctx.settings.runConfirm() === "no" && ctx.interactive && !isAgent(ctx.env);
|
|
95
|
+
}
|
|
75
96
|
const out = (ctx, line) => ctx.io.stdout(line + "\n");
|
|
76
97
|
/** The app that loads the research's version itself right after a hand-over (the research's numbers for its people). */
|
|
77
98
|
const APP_LOADS_ADOPTED = "3.9.0";
|
|
@@ -160,7 +181,7 @@ export async function openTask(ctx, run, lang, root, id, agent) {
|
|
|
160
181
|
}
|
|
161
182
|
const usd = taskEstimate(tree, task);
|
|
162
183
|
const note = lines(usd ? t("ui.link.open.estimate", { from: humanCost(usd[0], lang), to: humanCost(usd[1], lang) }) : t("ui.link.open.estimate.none"), t("ui.link.cost"));
|
|
163
|
-
if (!(await
|
|
184
|
+
if (!(await asksToStart(ctx, lang, root, t("ui.link.what.task.open.chat", { agent, what: shown }), note, false, !!usd)))
|
|
164
185
|
return false;
|
|
165
186
|
return (await run(["chat", "--task", task.id])) === 0;
|
|
166
187
|
}
|
|
@@ -186,7 +207,7 @@ export async function waitingDo(ctx, run, lang, root, id, what, agent, menu = fa
|
|
|
186
207
|
return (await run(["chat", "--task", task.id])) === 0;
|
|
187
208
|
const more = sameGroup(tree, task, ctx.settings.shared()?.value).length;
|
|
188
209
|
const said = `${t("ui.link.what.task.chat", { agent, what: shown })}${more ? t("ui.link.what.task.chat.more", { n: more }) : ""}`;
|
|
189
|
-
if (!(await
|
|
210
|
+
if (!(await asksToStart(ctx, lang, root, said, t("ui.link.cost"))))
|
|
190
211
|
return false;
|
|
191
212
|
return (await run(["chat", "--task", task.id])) === 0;
|
|
192
213
|
}
|
|
@@ -449,9 +470,9 @@ export async function placeSearch(ctx, run, lang, root, id) {
|
|
|
449
470
|
* place with &place=L…): the queue said here — how many places, in how many sessions by area, one session's estimate
|
|
450
471
|
* and the whole queue's, the gate of the runs and the limit of a session, what goes to searches — and on the person's
|
|
451
472
|
* yes the place queued (when it is not), the task of identification on top of the queue, then sessions started now if
|
|
452
|
-
* wanted: one batch, one session (asked yes or no); more, how many of them (placesSessions
|
|
453
|
-
* strom run --places (Ctrl-C after the session at work; the places left
|
|
454
|
-
* (403 places.link).
|
|
473
|
+
* wanted: one batch, one session (asked yes or no; at once under run.confirm no); more, how many of them (placesSessions,
|
|
474
|
+
* Enter at least one), run one after another by strom run --places (Ctrl-C after the session at work; the places left
|
|
475
|
+
* stay queued). The bridge never starts it (403 places.link).
|
|
455
476
|
*/
|
|
456
477
|
export async function placesRun(ctx, run, lang, root, id) {
|
|
457
478
|
const t = translator(lang);
|
|
@@ -475,7 +496,10 @@ export async function placesRun(ctx, run, lang, root, id) {
|
|
|
475
496
|
const minutes = ctx.settings.number("run.minutes", tree.config, DEFAULT_RUN_MINUTES);
|
|
476
497
|
const note = lines(t("ui.link.places.queue", { n, batches, max: BATCH_MAX }), t("ui.link.history.place.minutes", { from: est.session.minutes[0], to: est.session.minutes[1] }), est.session.usd ? t("ui.link.history.place.usd", { from: humanCost(est.session.usd[0], lang), to: humanCost(est.session.usd[1], lang) }) : undefined, batches > 1 && est.queue ? t("ui.link.places.whole", { from: est.queue.minutes[0], to: est.queue.minutes[1] }) : undefined, batches > 1 && est.queue?.usd ? t("ui.link.places.whole.usd", { from: humanCost(est.queue.usd[0], lang), to: humanCost(est.queue.usd[1], lang) }) : undefined, batches > 1 ? t(ctx.settings.runGate() ? "ui.link.places.later.gate" : "ui.link.places.later", { minutes }) : undefined, t("ui.link.places.private"), t("ui.link.cost"));
|
|
477
498
|
const what = p ? t("ui.link.what.places.one", { place: placeLabel(p, lang) }) : t("ui.link.what.places");
|
|
478
|
-
|
|
499
|
+
// a price in money said (sessions measured here): asked whatever run.confirm says
|
|
500
|
+
const priced = !!est.session.usd || (batches > 1 && !!est.queue?.usd);
|
|
501
|
+
const unasked = startsUnasked(ctx, priced);
|
|
502
|
+
if (!(await asksToStart(ctx, lang, root, what, note, false, priced)))
|
|
479
503
|
return false;
|
|
480
504
|
// the place queued by the person (a place queued already, the whole queue: shown, its task kept with it)
|
|
481
505
|
if ((await run(p && !inQueue ? ["place", "queue", p.id] : ["place", "queue"], true)) !== 0)
|
|
@@ -485,10 +509,11 @@ export async function placesRun(ctx, run, lang, root, id) {
|
|
|
485
509
|
out(ctx, t("ui.link.places.done"));
|
|
486
510
|
if (!task || task.state === "doing")
|
|
487
511
|
return true;
|
|
488
|
-
// one batch: one session, asked as it was
|
|
512
|
+
// one batch: one session, asked as it was — started at once where the line said so (run.confirm no, spec 123); more:
|
|
513
|
+
// how many now, each count with its estimate (a choice, not a yes: Enter starts at least one)
|
|
489
514
|
const now = queueView(queued).batches;
|
|
490
515
|
if (now <= 1) {
|
|
491
|
-
if (!(await ctx.confirm(t("ui.link.places.now"), false)))
|
|
516
|
+
if (!unasked && !(await ctx.confirm(t("ui.link.places.now"), false)))
|
|
492
517
|
return true;
|
|
493
518
|
return (await run(["run", "--task", task.id])) === 0;
|
|
494
519
|
}
|
|
@@ -509,9 +534,11 @@ const WORK_LIST = 5;
|
|
|
509
534
|
* n tasks or for as long as there is work, the time of a session, the gate (asked once for n tasks, before each
|
|
510
535
|
* session of the loop) — and on the person's yes (no by default) strom run --tasks n or strom run --loop in this
|
|
511
536
|
* terminal (Ctrl-C asks the session at work to finish and stops). The loop goes only under a gate: none set, it is not
|
|
512
|
-
* started — n tasks instead or the gate picked as in the settings, or nothing. The bridge never starts it.
|
|
537
|
+
* started — n tasks instead or the gate picked as in the settings, or nothing. The bridge never starts it. The tasks the
|
|
538
|
+
* link names (do=tasks&task=T…,T…: the app's "work on them now", spec 065 K7.2): those still open and held by nobody,
|
|
539
|
+
* one session each in the link's order (strom run --task), the rest said left out; none left: nothing started.
|
|
513
540
|
*/
|
|
514
|
-
export async function workRun(ctx, run, lang, root, what, n) {
|
|
541
|
+
export async function workRun(ctx, run, lang, root, what, n, picked) {
|
|
515
542
|
const t = translator(lang);
|
|
516
543
|
const tree = Tree.open(root, ctx.env);
|
|
517
544
|
// its sessions are strom run's: the agent's CLI not here said before anything else
|
|
@@ -521,6 +548,8 @@ export async function workRun(ctx, run, lang, root, what, n) {
|
|
|
521
548
|
const busy = busyIn(tree);
|
|
522
549
|
if (busy.runs || busy.sessions.length)
|
|
523
550
|
return stop(ctx, t("ui.link.work.busy", { runs: busy.runs, sessions: busy.sessions.length }));
|
|
551
|
+
if (picked)
|
|
552
|
+
return workOn(ctx, run, lang, root, tree, picked);
|
|
524
553
|
// the queue as strom run takes it: a story now and then, history by its pace, the one put next first, without what others hold
|
|
525
554
|
const held = othersAtWork(tree, tree.env).tasks;
|
|
526
555
|
const queue = taskQueue(tree, { strategy: ctx.settings.strategy(tree.config), ...RUN_TURNS }).filter((x) => !held.has(x.id));
|
|
@@ -560,11 +589,29 @@ export async function workRun(ctx, run, lang, root, what, n) {
|
|
|
560
589
|
const gate = spec ? gateLabel(ctx.settings.shared()?.value, spec) : undefined;
|
|
561
590
|
const note = lines(t("ui.run.next"), ...shown.map((x, k) => ` ${String(k + 1).padStart(2)}. ${truncate(humanTask(fresh, x.what, lang), 100)}${forStory(x) ? t("ui.run.story") : forHistory(x) ? t("ui.run.ofhistory") : ""}${lacksImages(fresh, x) ? t("ui.plan.images") : ""}`), queue.length > shown.length ? ` ${t("ui.plan.more", { n: queue.length - shown.length })}` : undefined, tasks !== undefined ? t("ui.link.work.tasks", { n: tasks, max: 2 * tasks }) : t("ui.link.work.loop"), t("ui.run.limit", { minutes }), gate ? t(tasks !== undefined ? "ui.link.work.gate.once" : "ui.link.work.gate.each", { gate }) : t("ui.link.work.gate.none"), t("ui.link.cost"));
|
|
562
591
|
const said = tasks !== undefined ? t("ui.link.what.work.tasks", { n: tasks }) : t("ui.link.what.work.loop");
|
|
563
|
-
if (!(await
|
|
592
|
+
if (!(await asksToStart(ctx, lang, root, said, note, false)))
|
|
564
593
|
return false;
|
|
565
594
|
out(ctx, t("ui.link.work.stop"));
|
|
566
595
|
return (await run(tasks !== undefined ? ["run", "--tasks", String(tasks)] : ["run", "--loop"])) === 0;
|
|
567
596
|
}
|
|
597
|
+
/** The tasks a link names worked on now (workRun): one session each, in the link's order, on the person's yes. */
|
|
598
|
+
async function workOn(ctx, run, lang, root, tree, ids) {
|
|
599
|
+
const t = translator(lang);
|
|
600
|
+
const held = othersAtWork(tree, tree.env).tasks;
|
|
601
|
+
const named = [...new Set(ids.map((id) => normId(id, "task")))];
|
|
602
|
+
const open = named.map((id) => tree.get(id)).filter((x) => !!x && x.type === "task" && !x.retracted && x.state === "open" && !held.has(x.id));
|
|
603
|
+
if (!open.length)
|
|
604
|
+
return stop(ctx, t("ui.link.work.picked.none"));
|
|
605
|
+
const shown = open.slice(0, WORK_LIST);
|
|
606
|
+
const minutes = ctx.settings.number("run.minutes", tree.config, DEFAULT_RUN_MINUTES);
|
|
607
|
+
const spec = ctx.settings.runGate();
|
|
608
|
+
const gate = spec ? gateLabel(ctx.settings.shared()?.value, spec) : undefined;
|
|
609
|
+
const note = lines(open.length < named.length ? t("ui.link.work.picked.gone", { n: named.length - open.length }) : undefined, t("ui.link.work.picked.head"), ...shown.map((x, k) => ` ${String(k + 1).padStart(2)}. ${truncate(humanTask(tree, x.what, lang), 100)}${lacksImages(tree, x) ? t("ui.plan.images") : ""}`), open.length > shown.length ? ` ${t("ui.plan.more", { n: open.length - shown.length })}` : undefined, t("ui.link.work.picked", { n: open.length }), t("ui.run.limit", { minutes }), gate ? t("ui.link.work.gate.once", { gate }) : t("ui.link.work.gate.none"), t("ui.link.cost"));
|
|
610
|
+
if (!(await asksToStart(ctx, lang, root, t("ui.link.what.work.picked", { n: open.length }), note, false)))
|
|
611
|
+
return false;
|
|
612
|
+
out(ctx, t("ui.link.work.stop"));
|
|
613
|
+
return (await run(["run", "--task", open.map((x) => x.id).join(",")])) === 0;
|
|
614
|
+
}
|
|
568
615
|
/**
|
|
569
616
|
* How many sessions of identification now, the queue in `batches` sessions: 1, 2, 3 and the whole queue (at most four
|
|
570
617
|
* answers and 0), each with its minutes and, measured, its price. Suggested: the whole queue when it is three sessions
|
|
@@ -83,6 +83,8 @@ export async function settingsMenu(ctx, run, lang, root, newer) {
|
|
|
83
83
|
if (!archive) {
|
|
84
84
|
const decide = ctx.settings.hypothesesDecide(tree);
|
|
85
85
|
parts.push({ label: t("ui.settings.hypotheses", { state: t(decide === "agent" ? "ui.hypotheses.decide.agent" : "ui.hypotheses.decide.person") }), act: () => hypothesesStep(ctx, run, lang, root) });
|
|
86
|
+
// the question before the agent starts from the Strom app's links (run.confirm, spec 123): this computer's
|
|
87
|
+
parts.push({ label: t("ui.settings.runconfirm", { state: t(ctx.settings.runConfirm() === "no" ? "ui.runconfirm.no" : "ui.runconfirm.ask") }), act: () => runConfirmStep(ctx, run, lang) });
|
|
86
88
|
}
|
|
87
89
|
if (parts.length) {
|
|
88
90
|
const i = await ctx.choose(t("ui.settings.wizard.what"), [{ label: t("ui.settings.wizard.all") }, ...parts.map((p) => ({ label: p.label }))], 0, { back: t("ui.browse.back") });
|
|
@@ -201,6 +203,23 @@ async function hypothesesStep(ctx, run, lang, root) {
|
|
|
201
203
|
const own = !!tree && readStored(tree, "hypotheses.decide", "") !== undefined;
|
|
202
204
|
await run(["config", "set", "hypotheses.decide", values[i], ...(own ? ["--for-tree"] : [])], true);
|
|
203
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* The question before the agent starts from the Strom app's links (run.confirm): asked first (the default) or not; 0
|
|
208
|
+
* back with nothing changed. Without the question: what still asks said, and strom config set asks the person's own
|
|
209
|
+
* yes itself (an agent never turns it off). Asked again: anyone's, at once.
|
|
210
|
+
*/
|
|
211
|
+
async function runConfirmStep(ctx, run, lang) {
|
|
212
|
+
const t = translator(lang);
|
|
213
|
+
const now = ctx.settings.runConfirm();
|
|
214
|
+
const values = ["ask", "no"];
|
|
215
|
+
const i = await ctx.choose(t("ui.runconfirm.pick"), [{ label: t("ui.runconfirm.choice.ask") }, { label: t("ui.runconfirm.choice.no") }], values.indexOf(now), { back: t("ui.browse.back") });
|
|
216
|
+
if (i === undefined || values[i] === now)
|
|
217
|
+
return;
|
|
218
|
+
if (values[i] === "ask")
|
|
219
|
+
return void (await run(["config", "unset", "run.confirm"], true));
|
|
220
|
+
ctx.io.stdout(t("ui.runconfirm.about") + "\n");
|
|
221
|
+
await run(["config", "set", "run.confirm", "no"], true);
|
|
222
|
+
}
|
|
204
223
|
/** The phone connection as the settings say it: off, or on with the phones paired (an error: said as one). */
|
|
205
224
|
function phoneLabel(ctx, lang) {
|
|
206
225
|
const t = translator(lang);
|