strom-research 1.37.0-beta.4 → 1.37.0-beta.5

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
@@ -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.37.0
9
9
 
10
- *Připravuje se: bety do 1.37.0-beta.4. Oddíl bude úplný s vydáním.*
10
+ *Připravuje se: bety do 1.37.0-beta.5. Oddíl bude úplný s vydáním.*
11
11
 
12
12
  - **Záznam archivu už nedrží portál ze seznamu stromu:** kniha s adresou na portálu, který seznam stromu zná (Porta
13
13
  fontium, Acta Publica…), už nedělá portál tak přísný jako archiv, pod kterým je zapsaná – portál se řídí svými
@@ -77,7 +77,8 @@ Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou n
77
77
  **Třídění materiálu bez dotazu:** nastavení `sort.confirm` (pro výzkum s `--for-tree`, jinak pro tento počítač):
78
78
  `ask` – výchozí, jako dosud: souhlas člověka s placenými čteními před každým tříděním – nebo `no`: `strom material
79
79
  sort` třídí hned, když o to člověk požádá, a řekne, že se neptalo; nikdy samo od sebe a běh, který nikdo nesleduje,
80
- se ptá dál. `no` nastaví jen člověk ve vlastním terminálu; zpět na dotaz může kdokoli, i aplikace Strom.
80
+ se ptá dál. `no` nastaví jen člověk ve vlastním terminálu nebo v aplikaci Strom na tomto
81
+ počítači (řekne to jedna řádka v logu mostu), nikdy agent; zpět na dotaz může kdokoli.
81
82
  - **Výzkum pro kopii rodokmenu:** odkaz aplikace Strom, který zakládá nový výzkum, může navrhnout jeho název (kopie
82
83
  stromu: „… (kopie)“); terminál ho nabídne k ponechání nebo přepsání a most aplikaci řekne složku, kde nové výzkumy
83
84
  vznikají. Strom předaný s čísly jiného výzkumu (kopie stromu, který výzkum měl, ze starší aplikace) dostane pro své
@@ -110,7 +111,8 @@ Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou n
110
111
  předplatné nebo kredit AI (rozhovor, úkol, práce na frontě, rozpor ponechaný agentovi, určení míst – u více dávek míst
111
112
  se zeptá jen na počet a Enter spustí aspoň jednu), se spustí hned; v terminálu to řekne jedna řádka i to, kde se dotaz
112
113
  znovu zapíná. Ptá se dál: dotaz s cenou v penězích, souhlasy, mazání, odeslání žádosti, podmínka samostatné práce a
113
- jakýkoli příkaz agenta. Dotaz vypíná jen člověk, nikdy agent.
114
+ jakýkoli příkaz agenta. Dotaz vypíná jen člověk – v terminálu nebo v aplikaci Strom na tomto počítači (řekne to jedna
115
+ řádka v logu mostu), nikdy agent.
114
116
  - **Smazání pramene:** pramen jde ve výzkumu smazat – `strom source retract` v terminálu nebo smazáním pramene v
115
117
  aplikaci Strom, jen člověkem, nikdy agentem (ten ho smí jen navrhnout s tím, co by podle `--dry-run` vzal). Hodnoty
116
118
  zůstanou; citace se z údajů odeberou a uchovají v prameni, údaj může být méně jistý, úkol stojící jen na něm se vzdá
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.37.0
9
9
 
10
- *In Vorbereitung: die Betas bis 1.37.0-beta.4. Der Abschnitt ist mit dem Release vollständig.*
10
+ *In Vorbereitung: die Betas bis 1.37.0-beta.5. Der Abschnitt ist mit dem Release vollständig.*
11
11
 
12
12
  - **Ein Archiveintrag der Forschung hält kein Portal der Liste von strom mehr:** ein Buch mit einer Adresse auf einem
13
13
  Portal, das die Liste von strom kennt (Porta fontium, Acta Publica…), macht das Portal nicht mehr so streng wie das
@@ -93,7 +93,8 @@ Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Ins
93
93
  diesen Computer): `ask` – der Standard, wie bisher: die Zustimmung der Person zu den bezahlten Lesungen vor jeder
94
94
  Sortierung – oder `no`: `strom material sort` sortiert sofort, wenn die Person darum bittet, und sagt, dass nicht
95
95
  gefragt wurde; nie von selbst, und ein Lauf, den niemand beobachtet, fragt weiterhin. `no` setzt nur die Person im
96
- eigenen Terminal; zurück zur Rückfrage kann jeder, auch die Strom-App.
96
+ eigenen Terminal oder in der Strom-App auf diesem Computer (eine Zeile im Log der Brücke sagt es), nie ein Agent;
97
+ zurück zur Rückfrage kann jeder.
97
98
  - **Eine Forschung für die Kopie eines Stammbaums:** der Link der Strom-App, der eine neue Forschung beginnt, kann ihren
98
99
  Namen vorschlagen (Kopie eines Baums: „… (Kopie)“); das Terminal bietet ihn zum Behalten oder Überschreiben an, und
99
100
  die Brücke nennt der App den Ordner, in dem neue Forschungen entstehen. Ein Baum, der mit den Nummern einer anderen
@@ -131,7 +132,8 @@ Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Ins
131
132
  nur nach der Anzahl gefragt, und Enter startet mindestens einen), startet sofort; eine Zeile im Terminal sagt es und
132
133
  wo die Rückfrage wieder eingeschaltet wird. Weiter gefragt wird: eine Frage mit einem Preis in Geld, Zustimmungen,
133
134
  Löschen, das Absenden einer Anfrage, die Bedingung der Alleinarbeit und jeder Befehl eines Agenten. Die Rückfrage
134
- schaltet nur der Mensch ab, nie ein Agent.
135
+ schaltet nur der Mensch ab – im Terminal oder in der Strom-App auf diesem Computer (eine Zeile im Log der Brücke sagt
136
+ es), nie ein Agent.
135
137
  - **Eine Quelle löschen:** Eine Quelle lässt sich in der Forschung löschen – `strom source retract` im Terminal oder
136
138
  durch Löschen der Quelle in der Strom-App, nur durch die Person, nie durch einen Agenten (er darf es nur vorschlagen,
137
139
  mit dem, was es laut `--dry-run` mitnähme). Die Werte bleiben; ihre Zitate werden von den Angaben genommen und in der
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.37.0
9
9
 
10
- *In preparation: the betas up to 1.37.0-beta.4. The section is complete with the release.*
10
+ *In preparation: the betas up to 1.37.0-beta.5. The section is complete with the release.*
11
11
 
12
12
  - **A research's archive no longer holds a portal of strom's list:** a book whose address is on a portal strom's list
13
13
  knows (Porta fontium, Acta Publica…) no longer makes the portal as strict as the archive the book is recorded under —
@@ -80,8 +80,8 @@ The changes of each version in short. The full notes and the install lines are o
80
80
  **Sorting the material without the question:** a setting `sort.confirm` (per research with `--for-tree`, else for
81
81
  this computer): `ask` — the default, as before: the person's yes to the paid readings before every sort — or `no`:
82
82
  `strom material sort` sorts at once when the person asks for it, saying it was not asked; never by itself, and a run
83
- nobody watches still asks. Only the person sets `no`, in their own terminal; asking again is anyone's, the Strom app
84
- too.
83
+ nobody watches still asks. Only the person sets `no`, in their own terminal or in the Strom app on this computer (one
84
+ line in the bridge's log says so), never an agent; asking again is anyone's.
85
85
  - **A research for a copy of a family tree:** the Strom app's link that starts a new research may suggest its name (a
86
86
  copy of a tree: "… (copy)"), offered in the terminal to keep or write over; the bridge tells the app the folder new
87
87
  researches are made in. A tree handed over with the numbers of another research (a copy of a tree that had one, from
@@ -115,7 +115,8 @@ The changes of each version in short. The full notes and the install lines are o
115
115
  to the agent, the identification of places — places of several batches ask only how many, and Enter starts at least
116
116
  one) starts at once; one line in the terminal says so and where the question is turned on again. Still asked: a
117
117
  question with a price in money, consents, deletions, a request sent, the condition of working alone, and any command
118
- of an agent. Only the person turns the question off — never an agent.
118
+ of an agent. Only the person turns the question off — in the terminal or in the Strom app on this computer (one line
119
+ in the bridge's log says so), never an agent.
119
120
  - **Deleting a source:** a source can be deleted in the research — `strom source retract` in the terminal or deleting
120
121
  the source in the Strom app, only by the person, never by an agent (it may only propose it, with what `--dry-run` says
121
122
  it would take). The values stay; its citations are taken off the facts and kept in the source, a fact may become less
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.37.0
9
9
 
10
- *W przygotowaniu: bety do 1.37.0-beta.4. Sekcja będzie kompletna z wydaniem.*
10
+ *W przygotowaniu: bety do 1.37.0-beta.5. Sekcja będzie kompletna z wydaniem.*
11
11
 
12
12
  - **Wpis archiwum w badaniu nie utrzymuje już portalu z listy stroma:** księga z adresem na portalu, który zna lista
13
13
  stroma (Porta fontium, Acta Publica…), nie czyni już portalu tak surowym jak archiwum, pod którym jest zapisana –
@@ -85,8 +85,8 @@ Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia inst
85
85
  **Sortowanie materiałów bez pytania:** ustawienie `sort.confirm` (dla badania z `--for-tree`, w przeciwnym razie
86
86
  dla tego komputera): `ask` – domyślne, jak dotąd: zgoda osoby na płatne odczyty przed każdym sortowaniem – albo
87
87
  `no`: `strom material sort` sortuje od razu, gdy osoba o to poprosi, i mówi, że nie pytano; nigdy samoczynnie,
88
- a przebieg, którego nikt nie obserwuje, nadal pyta. `no` ustawia tylko osoba we własnym terminalu; powrót do pytania
89
- może każdy, także aplikacja Strom.
88
+ a przebieg, którego nikt nie obserwuje, nadal pyta. `no` ustawia tylko osoba we własnym terminalu lub w aplikacji
89
+ Strom na tym komputerze (mówi o tym jedna linia w logu mostu), nigdy agent; powrót do pytania może każdy.
90
90
  - **Badanie dla kopii drzewa:** link aplikacji Strom, który zakłada nowe badanie, może zaproponować jego nazwę (kopia
91
91
  drzewa: „… (kopia)”); terminal proponuje ją do zachowania lub nadpisania, a most podaje aplikacji folder, w którym
92
92
  powstają nowe badania. Drzewo przekazane z numerami innego badania (kopia drzewa, które miało badanie, ze starszej
@@ -120,7 +120,8 @@ Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia inst
120
120
  agentowi, ustalanie miejsc – przy kilku partiach miejsc pyta się tylko o liczbę, a Enter uruchamia co najmniej jedną),
121
121
  uruchamia się od razu; jedna linia w terminalu mówi o tym i gdzie pytanie włącza się z powrotem. Nadal pytane są:
122
122
  pytanie z ceną w pieniądzach, zgody, usuwanie, wysłanie prośby, warunek samodzielnej pracy i każde polecenie agenta.
123
- Pytanie wyłącza tylko człowiek, nigdy agent.
123
+ Pytanie wyłącza tylko człowiek – w terminalu lub w aplikacji Strom na tym komputerze (mówi o tym jedna linia w logu
124
+ mostu), nigdy agent.
124
125
  - **Usuwanie źródła:** źródło można usunąć w badaniu – `strom source retract` w terminalu lub usunięciem źródła w
125
126
  aplikacji Strom, tylko przez osobę, nigdy przez agenta (może je jedynie zaproponować, z tym, co według `--dry-run` by
126
127
  zabrało). Wartości zostają; jego cytaty są zdejmowane z danych i przechowywane w źródle, dana może stać się mniej
@@ -2564,6 +2564,8 @@
2564
2564
  "ui.link.noterminal.new": "strom nemohl otevřít okno terminálu. Spustit {strom} a pak to zkusit z aplikace Strom znovu.",
2565
2565
  "ui.link.asks": "Aplikace Strom žádá: {what}\nVýzkum: {name}",
2566
2566
  "ui.link.go": "Pokračovat?",
2567
+ "ui.live.unasked.sort": "Dotaz před tříděním materiálu tohoto výzkumu vypnut v aplikaci Strom na tomto počítači (znovu zapnout: strom config set sort.confirm ask --for-tree).",
2568
+ "ui.live.unasked.run": "Dotaz před spuštěním agenta z aplikace Strom vypnut v aplikaci Strom na tomto počítači, pro všechny výzkumy zde (znovu zapnout: strom config unset run.confirm).",
2567
2569
  "ui.link.noconfirm": "▶ Spouští se bez potvrzení (výzkum {name}): {what}. Dotaz před spuštěním agenta se zapíná v Nastavení → 1 → „Spouštění agenta z aplikace Strom“, nebo strom config unset run.confirm.",
2568
2570
  "ui.link.cost": "Agent pracuje na předplatné nebo kredit AI.",
2569
2571
  "ui.link.tasks": "Výzkum zapíše úkoly pro agenta – teď se nic nehledá a nic se neplatí.",
@@ -2564,6 +2564,8 @@
2564
2564
  "ui.link.noterminal.new": "strom konnte kein Terminalfenster öffnen. {strom} starten und es dann erneut aus der Strom-App versuchen.",
2565
2565
  "ui.link.asks": "Die Strom-App bittet um: {what}\nForschung: {name}",
2566
2566
  "ui.link.go": "Fortfahren?",
2567
+ "ui.live.unasked.sort": "Die Rückfrage vor dem Sortieren des Materials dieser Forschung wurde in der Strom-App auf diesem Computer ausgeschaltet (wieder einschalten: strom config set sort.confirm ask --for-tree).",
2568
+ "ui.live.unasked.run": "Die Rückfrage vor dem Start des Agenten aus der Strom-App wurde in der Strom-App auf diesem Computer ausgeschaltet, für alle Forschungen hier (wieder einschalten: strom config unset run.confirm).",
2567
2569
  "ui.link.noconfirm": "▶ Startet ohne Rückfrage (Forschung {name}): {what}. Die Rückfrage vor dem Start des Agenten wird in den Einstellungen → 1 → „Agent aus der Strom-App starten“ eingeschaltet, oder strom config unset run.confirm.",
2568
2570
  "ui.link.cost": "Der Agent arbeitet auf das eigene Abonnement oder KI-Guthaben.",
2569
2571
  "ui.link.tasks": "Die Forschung schreibt Aufgaben für den Agenten – jetzt wird nichts gesucht und nichts bezahlt.",
@@ -2564,6 +2564,8 @@
2564
2564
  "ui.link.noterminal.new": "strom nie mógł otworzyć okna terminala. Uruchomić {strom}, a potem spróbować ponownie z aplikacji Strom.",
2565
2565
  "ui.link.asks": "Prośba z aplikacji Strom: {what}\nBadanie: {name}",
2566
2566
  "ui.link.go": "Kontynuować?",
2567
+ "ui.live.unasked.sort": "Pytanie przed sortowaniem materiałów tego badania wyłączono w aplikacji Strom na tym komputerze (ponowne włączenie: strom config set sort.confirm ask --for-tree).",
2568
+ "ui.live.unasked.run": "Pytanie przed uruchomieniem agenta z aplikacji Strom wyłączono w aplikacji Strom na tym komputerze, dla wszystkich badań tutaj (ponowne włączenie: strom config unset run.confirm).",
2567
2569
  "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.",
2568
2570
  "ui.link.cost": "Agent pracuje w ramach subskrypcji lub kredytu AI swojego konta.",
2569
2571
  "ui.link.tasks": "Badanie zapisze zadania dla agenta – teraz niczego się nie szuka i za nic się nie płaci.",
package/dist/cli/ui.js CHANGED
@@ -2502,6 +2502,8 @@ export const UI = {
2502
2502
  "ui.link.noterminal.new": "strom could not open a terminal window. Start {strom}, then try again from the Strom app.",
2503
2503
  "ui.link.asks": "The Strom app asks for: {what}\nResearch: {name}",
2504
2504
  "ui.link.go": "Go on?",
2505
+ "ui.live.unasked.sort": "The question before the material of this research is sorted was turned off in the Strom app on this computer (on again: strom config set sort.confirm ask --for-tree).",
2506
+ "ui.live.unasked.run": "The question before the agent starts from the Strom app was turned off in the Strom app on this computer, for every research here (on again: strom config unset run.confirm).",
2505
2507
  "ui.link.noconfirm": "▶ Started without the question (research {name}): {what}. The question before the agent starts is turned on in Settings → 1 → “Starting the agent from the Strom app”, or strom config unset run.confirm.",
2506
2508
  "ui.link.cost": "The agent works on the subscription or AI credit of its account.",
2507
2509
  "ui.link.tasks": "The research writes tasks for the agent — nothing is searched and nothing is paid now.",
@@ -1688,8 +1688,9 @@ function intakeDecision(ctx, key, value, scope) {
1688
1688
  }
1689
1689
  /**
1690
1690
  * A sort of the material without the question about its paid readings (sort.confirm no, spec 102 U8): a standing yes
1691
- * to what the readers spend — turned on by the person alone, their yes in a terminal too (a window where an agent asks;
1692
- * the Strom app's bridge never: 403 sort.raise); back to ask is anyone's. false: the person said no — nothing changed.
1691
+ * to what the readers spend — turned on by the person alone, their yes in a terminal too (a window where an agent asks),
1692
+ * or their switch in the Strom app on this computer (the bridge; never a device of the home network nor an agent: 403
1693
+ * sort.raise); back to ask is anyone's. false: the person said no — nothing changed.
1693
1694
  */
1694
1695
  async function sortDecision(ctx, key, value, scope) {
1695
1696
  if (key !== "sort.confirm")
@@ -1697,6 +1698,10 @@ async function sortDecision(ctx, key, value, scope) {
1697
1698
  const { now, next } = layerChange(ctx, key, value, scope);
1698
1699
  if (next !== "no" || now === "no")
1699
1700
  return true;
1701
+ // the Strom app on this computer (spec 123 P2): the bridge writes it in the app's environment — the person's switch
1702
+ // there, confirmed in the app's own dialog; never a device of the home network nor an agent (the bridge refuses them)
1703
+ if (ctx.env.STROM_FOR_APP === "1" && !isAgent(ctx.env))
1704
+ return true;
1700
1705
  const forTree = scope === "tree" ? " --for-tree" : "";
1701
1706
  return !!(await ctx.requireHumanYes(scope === "tree"
1702
1707
  ? "Sort files of this research's material by its readers at once when asked, without the question about the paid readings?"
@@ -1919,8 +1924,10 @@ async function setUserSetting(ctx, key, value) {
1919
1924
  if (!(await ctx.requireHumanYes(value ? `Let the gate "${value}" decide when the agent working alone goes on?` : `Remove the gate "${s.runGate()}" — the agent working alone no longer asks it?`, value ? `strom config set run.gate ${value}` : "strom config unset run.gate", "run.gate", ui(ctx.uiLang(), value ? "ui.consent.gate.set" : "ui.consent.gate.unset", { name: String(value ?? s.runGate()) }))))
1920
1925
  return false;
1921
1926
  // The agent started from the Strom app's links without the question (a standing yes to its subscription or credit):
1922
- // turned on by the user alone, their yes in a terminal too; asking again is anyone's.
1923
- if (key === "run.confirm" && value === "no" && s.runConfirm() !== "no")
1927
+ // turned on by the user alone — their yes in a terminal too, or their switch in the Strom app on this computer (the
1928
+ // bridge writes it in the app's environment; never for a device of the home network nor an agent, spec 123 P2);
1929
+ // asking again is anyone's.
1930
+ if (key === "run.confirm" && value === "no" && s.runConfirm() !== "no" && !(ctx.env.STROM_FOR_APP === "1" && !isAgent(ctx.env)))
1924
1931
  if (!(await ctx.requireHumanYes("Start the agent from the Strom app's links without asking first (it works on the subscription or AI credit)?", "strom config set run.confirm no", "run.confirm", ui(ctx.uiLang(), "ui.consent.run.confirm"))))
1925
1932
  return false;
1926
1933
  // A person's pace for the images of restricted archives: theirs alone, faster or slower — never the agent's.
@@ -118,7 +118,7 @@ export const SETTINGS = [
118
118
  // Read from the config file only, changed by the user alone: the gate decides what working alone spends.
119
119
  { key: "run.gate", env: "", tree: false, kind: "plugin", description: "a condition on the agent working alone: the gate (plugins/gates/<name>) strom asks before each session of strom run — go on, wait or stop; its name, then what it is given (strom gate list; e.g. claude-usage 10: the Claude subscription's daily ration, 10 points in hand; claude-usage 10 --cap 95: and never past 95 % of the week, before every session of every run, no “start anyway”) — only you set it. Runs side by side on this computer ask it one at a time (the next once the session the gate let go has begun), and a plan limit one run meets holds every run of that agent here until it resets" },
120
120
  // Read from the config file only, changed by the user alone: a standing yes to the agent's subscription or credit.
121
- { key: "run.confirm", env: "", tree: false, kind: "choice", choices: ["ask", "no"], description: "the question before the agent starts from a link of the Strom app (a conversation, a task, the work on the queue, a conflict left to the agent, the identification of places): ask (default — said and asked in the terminal) or no (started at once, one line says so; what says a price in money, a consent, a deletion, a request sent and the gate run.gate still ask; an agent's own command is never let through) — every research on this computer, only you set it" },
121
+ { key: "run.confirm", env: "", tree: false, kind: "choice", choices: ["ask", "no"], description: "the question before the agent starts from a link of the Strom app (a conversation, a task, the work on the queue, a conflict left to the agent, the identification of places): ask (default — said and asked in the terminal) or no (started at once, one line says so; what says a price in money, a consent, a deletion, a request sent and the gate run.gate still ask; an agent's own command is never let through) — every research on this computer; only you set it, in your terminal or the Strom app on this computer" },
122
122
  // Read from the config file only, changed by the user alone: how fast strom may take images of an archive whose
123
123
  // terms restrict automation, once the user allowed it slowly (core/terms.ts).
124
124
  { key: "archive.pace", env: "", tree: false, kind: "pace", description: "a person's pace for the images of an archive whose terms restrict automated access, once you allowed it slowly: seconds between two images, then requests to the archive an hour, its catalogue counted too (default \"10 120\"; auto: the default) — the service's own pace stays the slowest; one archive's own: strom allow host <host> --pace/--per-hour — only you set it" },
@@ -179,7 +179,7 @@ export const SETTINGS = [
179
179
  // app, a terminal), for every research on this computer or for one (strom.json, both ways); off is anyone's.
180
180
  // the person's switch alone (like census): an agent never turns it on — sorting spends the plan and changes the tree
181
181
  { key: "intake.auto", env: "", tree: true, kind: "choice", choices: ["off", "on"], description: "files sent to the research — a batch of the Strom app or a phone once whole, a single file of the app, material the person adds (strom intake): off (default — nothing of an agent starts by itself: the files wait in the material unsorted until the person asks: the app's Sort by agent…, strom input batch done --sort, strom intake --sort) or on (tasks for the agent: a batch's sorting tasks of about 25 files each, taken up first; an intake task for a file; a task to read the scan of a source). Turned on by the person alone" },
182
- { key: "sort.confirm", env: "", tree: true, kind: "choice", choices: ["ask", "no"], description: "the question before files of the material are sorted by readers of the research (strom material sort, the person's ask): ask (default — the person's yes to the paid readings before every sort) or no (sorted at once on the person's own ask, no question about the readings; never by itself, a run nobody watches still asks) — for this tree with --for-tree, else every research on this computer; only you set it" },
182
+ { key: "sort.confirm", env: "", tree: true, kind: "choice", choices: ["ask", "no"], description: "the question before files of the material are sorted by readers of the research (strom material sort, the person's ask): ask (default — the person's yes to the paid readings before every sort) or no (sorted at once on the person's own ask, no question about the readings; never by itself, a run nobody watches still asks) — for this tree with --for-tree, else every research on this computer; only you set it, in your terminal or the Strom app on this computer" },
183
183
  { key: "census", env: "", tree: true, kind: "choice", choices: ["off", "on"], description: "census records as a source of the research: a household in one year shows who lived with whom and where each came from — tasks of kind census and the method's page for them (most archives only show their census sheets: they come by hand, as a screenshot, a task waiting for its images; nothing promises them fetched): on or off (unset: off) — only you turn it on (the menu's settings, the Strom app, strom config set census on in a terminal), for every research on this computer or with --for-tree for one (a tree's own value wins both ways); the agent may propose it once (strom census propose); off is anyone's" },
184
184
  { key: "mode", env: "", tree: false, kind: "choice", choices: ["research", "archive"], description: "what a new research on this computer is: research (default — an agent works on it; while none is here it waits for one, kept as an archive) or archive (the data come from the Strom app, no agent — the person's choice: the setup wizard asks it with an agent here, the menu's settings) — a research's own: strom mode" },
185
185
  { key: "updates", env: "STROM_UPDATES", tree: false, kind: "choice", choices: ["check", "off"], description: "look for new versions of strom: check (default — at most once a day, one small file from the project's releases; strom says so, strom update installs it) or off" },
@@ -207,6 +207,9 @@ function writeAllowed(what, sub, act, rest, n, body) {
207
207
  // only fewer runs at once: the bridge itself refuses more from any app (403 runs.raise, the person's terminal)
208
208
  if (n === 2 && sub === "runs")
209
209
  return undefined;
210
+ // a question asked again (sort.confirm, run.confirm: ask) is anyone's; taken away only on the computer (spec 123 P2)
211
+ if (n === 2 && (sub === "sort" || sub === "run"))
212
+ return only(body?.confirm === "ask" && Object.keys(body).length === 1, `settings.${sub}`);
210
213
  return deny(sub === "sort" ? "settings.sort" : "settings");
211
214
  default:
212
215
  // read (again, cancel), hypotheses, stories, experiments, intake, sourceTask, live, offline, books, census,
@@ -301,12 +301,12 @@ function appGate(env) {
301
301
  return undefined;
302
302
  }
303
303
  /** The copy of the app the gateway serves now: downloaded and of a version the gate lets in; none — the phone's page. */
304
- function servable(env) {
304
+ export function servable(env) {
305
305
  const files = deviceAppFiles(env);
306
306
  if (!files)
307
307
  return undefined;
308
- const gate = appGate(env);
309
- return (gate ? deviceAppServable(files.version, gate) : deviceAppServable(files.version)) ? files : undefined;
308
+ // the gate of a test of the loopback, else the app's (undefined: its default); a copy of its beta site by its own gate too
309
+ return deviceAppServable(files.version, appGate(env), files.from) ? files : undefined;
310
310
  }
311
311
  /** The origin of the copy of the app the devices are given — what the bridge lets write (its pages alone). */
312
312
  function appOrigin(env) {
@@ -147,7 +147,7 @@ export function deviceAppFiles(env) {
147
147
  const dir = path.join(deviceAppRoot(env), n.version);
148
148
  if (!fs.existsSync(path.join(dir, "index.html")))
149
149
  return undefined;
150
- return { dir, version: n.version, etag: n.etag };
150
+ return { dir, version: n.version, etag: n.etag, ...(n.from ? { from: n.from } : {}) };
151
151
  }
152
152
  /** For /phone: a copy ready (its version), one being downloaded, or none. */
153
153
  export function deviceAppState(env) {
@@ -235,7 +235,11 @@ export async function ensureDeviceApp(env, opts = {}) {
235
235
  const n = readNote(env);
236
236
  const kept = deviceAppFiles(env);
237
237
  const t = now();
238
- if (kept && n.checkedAt && t - Date.parse(n.checkedAt) < DEVICE_APP_EVERY_MS && t >= Date.parse(n.checkedAt))
238
+ // a copy of another site than the one asked now (the app moved to its beta, or back), or one an older strom did not
239
+ // say the site of: downloaded again, at once
240
+ const source = deviceAppSource(env);
241
+ const sameSite = !source || !kept || kept.from === new URL(source).origin;
242
+ if (kept && sameSite && n.checkedAt && t - Date.parse(n.checkedAt) < DEVICE_APP_EVERY_MS && t >= Date.parse(n.checkedAt))
239
243
  return { result: "fresh", version: kept.version };
240
244
  if (n.failedAt && t - Date.parse(n.failedAt) < DEVICE_APP_RETRY_MS && t >= Date.parse(n.failedAt))
241
245
  return { result: "failed", error: n.error ?? "failed lately" };
@@ -247,7 +251,7 @@ export async function ensureDeviceApp(env, opts = {}) {
247
251
  return { result: "busy" };
248
252
  throw err;
249
253
  }
250
- const result = await download(env, kept, now);
254
+ const result = await download(env, kept, now, sameSite);
251
255
  if (result.result === "failed") {
252
256
  writeNote(env, (x) => ({ ...x, failedAt: new Date(now()).toISOString(), error: result.error }));
253
257
  notePhone(env, `the app for the devices not downloaded: ${result.error}`);
@@ -261,17 +265,17 @@ export async function ensureDeviceApp(env, opts = {}) {
261
265
  release?.();
262
266
  }
263
267
  }
264
- async function download(env, kept, now) {
268
+ async function download(env, kept, now, sameSite = true) {
265
269
  const source = deviceAppSource(env);
266
270
  if (!source)
267
271
  return { result: "failed", error: "no address of the Strom app to download it from" };
268
272
  const base = new URL(source);
269
273
  const at = () => new Date(now()).toISOString();
270
274
  try {
271
- const index = await get(new URL("index.html", base).href, kept?.etag ? { "If-None-Match": kept.etag } : {});
272
- if (index.status === 304 && kept) {
275
+ const index = await get(new URL("index.html", base).href, kept?.etag && sameSite ? { "If-None-Match": kept.etag } : {});
276
+ if (index.status === 304 && kept && sameSite) {
273
277
  await index.body?.cancel().catch(() => { });
274
- writeNote(env, (x) => ({ ...x, checkedAt: at(), failedAt: undefined, error: undefined }));
278
+ writeNote(env, (x) => ({ ...x, from: base.origin, checkedAt: at(), failedAt: undefined, error: undefined }));
275
279
  return { result: "unchanged", version: kept.version };
276
280
  }
277
281
  if (index.status !== 200) {
@@ -339,7 +343,7 @@ async function download(env, kept, now) {
339
343
  return { result: "failed", error: `SHASUMS256.txt: HTTP ${sums.status}` };
340
344
  }
341
345
  store(env, version, files);
342
- writeNote(env, (x) => ({ ...x, version, ...(etag ? { etag } : { etag: undefined }), checkedAt: at(), failedAt: undefined, error: undefined }));
346
+ writeNote(env, (x) => ({ ...x, version, from: base.origin, ...(etag ? { etag } : { etag: undefined }), checkedAt: at(), failedAt: undefined, error: undefined }));
343
347
  prune(env, version);
344
348
  notePhone(env, `the app for the devices downloaded: ${version} from ${base.origin}`);
345
349
  return { result: "fetched", version };
package/dist/core/live.js CHANGED
@@ -681,6 +681,12 @@
681
681
  // POST <token>/settings/runs {max: 1…10}: lower — strom config set run.parallel n (the runs at work go on) — {ok,
682
682
  // limits}; higher: 403 runs.raise {command} (only the person raises it, in the terminal);
683
683
  // 400 runs.max (feature run.limit)
684
+ // POST <token>/settings/run {"confirm": "ask" | "no"} (exactly; spec 123 P2, feature run.confirm): the question before
685
+ // the agent starts from the app's links (run.confirm, this computer's — every research; /status
686
+ // work.confirm) — "ask": strom config unset run.confirm, from anywhere; "no": strom config set
687
+ // run.confirm no, only the Strom app on this computer (one line in live.log), else 403 run.raise
688
+ // {command, reason: device|browser} — {run {confirm}} (as it holds already: nothing written);
689
+ // 400 run.body, 409 run.archive (+ reasonCode), 503 research.busy, 500 run.failed
684
690
  // POST <token>/live {idleMinutes: 0…10080}: strom config set live.idleMinutes (this computer's, every bridge takes
685
691
  // it; nothing committed) — {live: {idleMinutes, idleChoices}} as /status live says it (feature
686
692
  // live.idle) — or {do: "stop"}: 202 {stopping: true}, ended as strom live stop ends it (end
@@ -714,8 +720,11 @@
714
720
  // POST <token>/settings/sort {"confirm": "ask" | "no"} (exactly; spec 102 U8, feature sort.confirm, no gate of the
715
721
  // app's version): the question before a sort of the material (strom material sort) — "ask":
716
722
  // strom config set sort.confirm ask --for-tree — {sort {confirm}, head, parent (head when the
717
- // value holds already: nothing written)}; "no" only by the person in the terminal: 403
718
- // sort.raise {command: strom config set sort.confirm no --for-tree} (200 when no holds already);
723
+ // value holds already: nothing written)}; "no" (strom config set sort.confirm no --for-tree) by
724
+ // the person in the terminal, or the Strom app on this computer (spec 123 P2, feature
725
+ // sort.confirm.app; one line in live.log in the research's language) — never a device of the
726
+ // home network nor what is no browser's fetch (no Sec-Fetch-Mode: cors): 403 sort.raise
727
+ // {command, reason: device|browser} (200 when no holds already);
719
728
  // 400 sort.body, 409 sort.archive (an archive, a research waiting for its agent; + reasonCode),
720
729
  // 409 seal.foreign | tree.not-downloaded, 423 locked, 503 research.busy, 500 sort.failed. The
721
730
  // bridge sorts nothing by it (POST /material/sort is the app's dialog, the person's ask). /status
@@ -1925,9 +1934,9 @@ export function tagMatches(req, tag) {
1925
1934
  const MEDIA_REF_UNKNOWN = "sync.media-ref-unknown";
1926
1935
  /** How many hashes POST /media/known takes at once. */
1927
1936
  export const MEDIA_KNOWN_MAX = 5000;
1928
- export const BRIDGE_FEATURES = ["sync.again", "sync.undoneSince", "sync.takenBack", "sync.conflictEdit", "sync.since", "sync.ids", "family.noCouple", "family.alone", "adopt.transfer", "adopt.empty", "material.list", "person.titles", "media.codes", "hypothesis.links", "status.recent", "spend.readers", "hypothesis.intree", "archive.permission", "task.check", "waiting.groups", "waiting.sent", "waiting.note", "batch.kept", "live.end", "whats.new", "terminal.choice", "person.marriedSurname", "phone", "read.now", "read.sync", "excerpt.get", "log.sources", "material.assign", "material.thumb", "seal.foreign", "tree.state", "disk.full", "tree.notDownloaded", "sync.removed", "tree.kind", "experiments", "experiments.off", "experiments.link", "experiments.split", "history.events", "history.hide", "experiments.pace", "history.first", "history.regions", "history.hide.all", "history.skip", "history.map", "history.delete", "history.delete.restore", "stories.history", "history.place", "surnames.suggest", "surnames.read", "lineage.read", "duplicates.judge", "quality.dismiss", "quality.read", "person.primary", "fixes.list", "fixes.towns", "history.back", "places.identify", "places.answer", "places.undo", "tasks.offLine", "status.busy", "history.kinds", "history.align", "places.nameKinds", "directions.edit", "directions.order", "directions.found", "directions.people", "directions.places", "offLine.branches", "queue.own", "story.sources", "queue.page", "status.parts", "waiting.answer", "browser.state", "working.place", "working.family", "working.helps", "hypotheses.decide", "sources.confirm", "read.sourceTask", "read.sourceTask.unsure", "read.choose", "read.choices.now", "read.source", "read.sourceEntry", "read.blindText", "read.kinds", "read.variantKind", "read.readerState", "live.idle", "live.stop", "live.start", "sources.proposal", "sources.proposal.undo", "origin", "origin.ids", "verify", "verify.bulk", "facts.confirm", "verify.stop", "ged.stale", "facts.confirm.value", "ged.etag", "ged.imagesByHash", "hypothesis.decide.link", "hypotheses.accept.link", "sources.fields", "sources.split", "queue.search", "queue.next", "work.link", "run.tasks", "queue.kind", "work.tasks", "verify.tryFirst", "event.share", "citations.order", "sync.notWritten.codes", "citations.main", "citations.remove", "books", "media.app", "material.links", "material.edit", "material.uses", "material.sort", "tasks.audit", "handoffs", "material.sourceOf", "material.left", "material.sameAs", "material.sortRun", "material.delete", "inbox.aside", "source.retract", "material.trees", "census", "name-status", "task.holds", "archive.holds", "media.queued", "media.known", "intake.auto", "run.lines", "run.agents", "run.stop", "run.limit", "directions.move", "sync.mediaRef", "person.contact", "media.list", "media.list.source", "waiting.gain", "sort.confirm", "working.saving", "waiting.retry"];
1937
+ export const BRIDGE_FEATURES = ["sync.again", "sync.undoneSince", "sync.takenBack", "sync.conflictEdit", "sync.since", "sync.ids", "family.noCouple", "family.alone", "adopt.transfer", "adopt.empty", "material.list", "person.titles", "media.codes", "hypothesis.links", "status.recent", "spend.readers", "hypothesis.intree", "archive.permission", "task.check", "waiting.groups", "waiting.sent", "waiting.note", "batch.kept", "live.end", "whats.new", "terminal.choice", "person.marriedSurname", "phone", "read.now", "read.sync", "excerpt.get", "log.sources", "material.assign", "material.thumb", "seal.foreign", "tree.state", "disk.full", "tree.notDownloaded", "sync.removed", "tree.kind", "experiments", "experiments.off", "experiments.link", "experiments.split", "history.events", "history.hide", "experiments.pace", "history.first", "history.regions", "history.hide.all", "history.skip", "history.map", "history.delete", "history.delete.restore", "stories.history", "history.place", "surnames.suggest", "surnames.read", "lineage.read", "duplicates.judge", "quality.dismiss", "quality.read", "person.primary", "fixes.list", "fixes.towns", "history.back", "places.identify", "places.answer", "places.undo", "tasks.offLine", "status.busy", "history.kinds", "history.align", "places.nameKinds", "directions.edit", "directions.order", "directions.found", "directions.people", "directions.places", "offLine.branches", "queue.own", "story.sources", "queue.page", "status.parts", "waiting.answer", "browser.state", "working.place", "working.family", "working.helps", "hypotheses.decide", "sources.confirm", "read.sourceTask", "read.sourceTask.unsure", "read.choose", "read.choices.now", "read.source", "read.sourceEntry", "read.blindText", "read.kinds", "read.variantKind", "read.readerState", "live.idle", "live.stop", "live.start", "sources.proposal", "sources.proposal.undo", "origin", "origin.ids", "verify", "verify.bulk", "facts.confirm", "verify.stop", "ged.stale", "facts.confirm.value", "ged.etag", "ged.imagesByHash", "hypothesis.decide.link", "hypotheses.accept.link", "sources.fields", "sources.split", "queue.search", "queue.next", "work.link", "run.tasks", "queue.kind", "work.tasks", "verify.tryFirst", "event.share", "citations.order", "sync.notWritten.codes", "citations.main", "citations.remove", "books", "media.app", "material.links", "material.edit", "material.uses", "material.sort", "tasks.audit", "handoffs", "material.sourceOf", "material.left", "material.sameAs", "material.sortRun", "material.delete", "inbox.aside", "source.retract", "material.trees", "census", "name-status", "task.holds", "archive.holds", "media.queued", "media.known", "intake.auto", "run.lines", "run.agents", "run.stop", "run.limit", "directions.move", "sync.mediaRef", "person.contact", "media.list", "media.list.source", "waiting.gain", "sort.confirm", "working.saving", "waiting.retry", "sort.confirm.app", "run.confirm"];
1929
1938
  /** What only a research with its agent here does (accepts.read: none in an archive, nor where it waits for its agent). */
1930
- const AGENT_FEATURES = new Set(["material.sort", "run.lines", "run.agents", "run.stop", "run.limit", "directions.move", "sort.confirm"]);
1939
+ const AGENT_FEATURES = new Set(["material.sort", "run.lines", "run.agents", "run.stop", "run.limit", "directions.move", "sort.confirm", "sort.confirm.app", "run.confirm"]);
1931
1940
  const withoutAgent = (features) => features.filter((f) => !AGENT_FEATURES.has(f));
1932
1941
  /**
1933
1942
  * The gateway of the devices of the home network (devices.mode on, the person's in their terminal): the dialog to
@@ -4090,9 +4099,15 @@ export function serveLive(root, env) {
4090
4099
  writeFor(req, res, origin, runsLimitWrite());
4091
4100
  return;
4092
4101
  }
4093
- // the question before a sort of the material (spec 102 U8): asked again from the app, never taken away there
4102
+ // the question before a sort of the material (spec 102 U8): asked again from anywhere, taken away only by the app on
4103
+ // this computer (spec 123 P2)
4094
4104
  if (req.method === "POST" && t === token && what === "settings" && sub === "sort" && !act) {
4095
- writeFor(req, res, origin, sortConfirmWrite());
4105
+ writeFor(req, res, origin, sortConfirmWrite(req));
4106
+ return;
4107
+ }
4108
+ // the question before the agent starts from the app's links (spec 123 P2): the same, this computer's
4109
+ if (req.method === "POST" && t === token && what === "settings" && sub === "run" && !act) {
4110
+ writeFor(req, res, origin, runConfirmWrite(req));
4096
4111
  return;
4097
4112
  }
4098
4113
  // census records as a source (spec 106)
@@ -7236,15 +7251,33 @@ export function serveLive(root, env) {
7236
7251
  },
7237
7252
  };
7238
7253
  };
7254
+ /**
7255
+ * Who may take a question away from the app (spec 123 P2: sort.confirm no, run.confirm no — a standing yes to what the
7256
+ * agent and its readers spend): only the Strom app in a browser on this computer, the person's switch confirmed in the
7257
+ * app's own dialog. Never a device of the home network (its gateway names it: "device") nor what is no browser's fetch
7258
+ * (a page's fetch says Sec-Fetch-Mode: cors, which a program has to make up: "browser"). undefined: it may. A fence,
7259
+ * not a vault: an agent that read the bridge's secret could make up the browser's headers too — kept away by the tree's
7260
+ * rules and hooks (core/bridgeguard.ts), and the change is said in live.log in the research's language.
7261
+ */
7262
+ const lowersFrom = (req) => {
7263
+ if (deviceOf(req) || req.headers[DEVICE_HEADER] !== undefined)
7264
+ return "device";
7265
+ if (req.headers["sec-fetch-mode"] !== "cors")
7266
+ return "browser";
7267
+ return undefined;
7268
+ };
7239
7269
  /**
7240
7270
  * The question before a sort of the material (POST /settings/sort {"confirm": "ask" | "no"}, exactly; spec 102 U8,
7241
- * feature sort.confirm): asked again from the app at once (strom config set sort.confirm ask --for-tree); taken away
7242
- * only by the person in the terminal (a standing yes to paid readings): 403 sort.raise {command}. As it is already:
7243
- * 200, nothing written, head = parent. {sort: {confirm}, head, parent}. 400 sort.body; not in an archive nor a research
7244
- * waiting for its agent (409 sort.archive, reasonCode: its state).
7271
+ * feature sort.confirm): asked again from the app at once (strom config set sort.confirm ask --for-tree, from
7272
+ * anywhere); taken away (a standing yes to paid readings: strom config set sort.confirm no --for-tree) by the person
7273
+ * in the terminal or in the Strom app on this computer (spec 123 P2, feature sort.confirm.app; said in live.log) —
7274
+ * never by a device of the home network nor what is no browser's fetch: 403 sort.raise {command, reason: device |
7275
+ * browser}. As it is already: 200, nothing written, head = parent. {sort: {confirm}, head, parent}. 400 sort.body; not
7276
+ * in an archive nor a research waiting for its agent (409 sort.archive, reasonCode: its state).
7245
7277
  */
7246
- const sortConfirmWrite = () => {
7278
+ const sortConfirmWrite = (req) => {
7247
7279
  let before = "";
7280
+ let lowered = false;
7248
7281
  return {
7249
7282
  what: "the question before a sort",
7250
7283
  codes: { badBody: "sort.body", busy: "research.busy", failed: "sort.failed" },
@@ -7259,13 +7292,21 @@ export function serveLive(root, env) {
7259
7292
  if (new Settings(env, {}).sortConfirm(tree.config) === body.confirm)
7260
7293
  return { code: 200, body: { sort: { confirm: body.confirm }, head: before, parent: before } };
7261
7294
  const command = "strom config set sort.confirm no --for-tree";
7262
- if (body.confirm === "no")
7263
- return { code: 403, body: { ...refusal(`a sort without the question only by the person in the terminal: ${command}`, "sort.raise"), command } };
7295
+ if (body.confirm === "no") {
7296
+ const reason = lowersFrom(req);
7297
+ if (reason)
7298
+ return { code: 403, body: { ...refusal(`a sort without the question only by the person, in the terminal or the Strom app on this computer: ${command}`, "sort.raise", { reason }), command, reason } };
7299
+ lowered = true;
7300
+ return { args: ["config", "set", "sort.confirm", "no", "--for-tree"] };
7301
+ }
7264
7302
  return { args: ["config", "set", "sort.confirm", "ask", "--for-tree"] };
7265
7303
  },
7266
7304
  done(tree, _data, h) {
7267
7305
  const now = Tree.open(tree.root, env);
7268
- return { sort: { confirm: new Settings(env, {}).sortConfirm(now.config) }, head: h, parent: before };
7306
+ const confirm = new Settings(env, {}).sortConfirm(now.config);
7307
+ if (lowered && confirm === "no")
7308
+ noteLive(root, ui(langOf(root, env), "ui.live.unasked.sort"));
7309
+ return { sort: { confirm }, head: h, parent: before };
7269
7310
  },
7270
7311
  refused(tree, code, why) {
7271
7312
  if (code === "archive" || code === "agent.missing")
@@ -7367,6 +7408,51 @@ export function serveLive(root, env) {
7367
7408
  done: () => ({ ok: true, limits: runLimits(root, new Settings(env, {})) }),
7368
7409
  refused: () => undefined,
7369
7410
  });
7411
+ /**
7412
+ * The question before the agent starts from the Strom app's links (POST /settings/run {"confirm": "ask" | "no"},
7413
+ * exactly; spec 123 P2, feature run.confirm; this computer's, every research): asked again from anywhere (strom config
7414
+ * unset run.confirm); taken away (a standing yes to the subscription or AI credit: strom config set run.confirm no) by
7415
+ * the person in the terminal or in the Strom app on this computer (said in live.log) — never by a device of the home
7416
+ * network nor what is no browser's fetch: 403 run.raise {command, reason: device | browser}. {run: {confirm}} (as it is
7417
+ * already: nothing written). 400 run.body; not in an archive nor a research waiting for its agent (409 run.archive,
7418
+ * reasonCode: its state). What says a price in money, consents, runs nobody watches and the gate run.gate still ask.
7419
+ */
7420
+ const runConfirmWrite = (req) => {
7421
+ let lowered = false;
7422
+ return {
7423
+ what: "the question before the agent starts",
7424
+ codes: { badBody: "run.body", busy: "research.busy", failed: "run.failed" },
7425
+ busyStatus: 503,
7426
+ ask(tree, body) {
7427
+ const keys = Object.keys(body);
7428
+ if (keys.length !== 1 || keys[0] !== "confirm" || (body.confirm !== "ask" && body.confirm !== "no"))
7429
+ return { code: 400, body: refusal(`the body: {"confirm": "ask"} or {"confirm": "no"}`, "run.body") };
7430
+ if (actsAsArchive(tree))
7431
+ return { code: 409, body: { ...refusal("nobody researches here: no agent starts", "run.archive"), reasonCode: stateOf(tree) } };
7432
+ if (new Settings(env, {}).runConfirm() === body.confirm)
7433
+ return { code: 200, body: { run: { confirm: body.confirm } } };
7434
+ if (body.confirm === "ask")
7435
+ return { args: ["config", "unset", "run.confirm"] };
7436
+ const command = "strom config set run.confirm no";
7437
+ const reason = lowersFrom(req);
7438
+ if (reason)
7439
+ return { code: 403, body: { ...refusal(`the agent without the question only by the person, in the terminal or the Strom app on this computer: ${command}`, "run.raise", { reason }), command, reason } };
7440
+ lowered = true;
7441
+ return { args: ["config", "set", "run.confirm", "no"] };
7442
+ },
7443
+ done() {
7444
+ const confirm = new Settings(env, {}).runConfirm();
7445
+ if (lowered && confirm === "no")
7446
+ noteLive(root, ui(langOf(root, env), "ui.live.unasked.run"));
7447
+ return { run: { confirm } };
7448
+ },
7449
+ refused(tree, code, why) {
7450
+ if (code === "archive" || code === "agent.missing")
7451
+ return { code: 409, body: { ...refusal(why, "run.archive"), reasonCode: stateOf(tree) } };
7452
+ return undefined;
7453
+ },
7454
+ };
7455
+ };
7370
7456
  const liveWrite = () => ({
7371
7457
  what: "the bridge's idle time",
7372
7458
  codes: { badBody: "live.body", busy: "research.busy", failed: "live.failed" },
@@ -19,7 +19,7 @@ import { diskVersion, lastingLauncher, stromLauncher } from "./self.js";
19
19
  import { VERSION } from "./tree.js";
20
20
  import { ui, UI } from "../cli/ui.js";
21
21
  import { assetPath, readAsset } from "./assets.js";
22
- import { Settings } from "./config.js";
22
+ import { loadUserConfig, Settings } from "./config.js";
23
23
  import { phoneSend } from "./phone-send.js";
24
24
  import { deviceGateway } from "./device-gateway.js";
25
25
  import { noteTestProcess } from "./testnote.js";
@@ -784,9 +784,37 @@ export function pageLang(env, opts) {
784
784
  .find((l) => ok(l));
785
785
  return ok(opts.phone?.lang) ?? ok(opts.asked) ?? ok(set.value) ?? ok(browser) ?? "en";
786
786
  }
787
- /** The phone's page (assets/phone/index.html) in a language, its script and style allowed by the nonce alone. */
788
- export function phonePage(lang, nonce) {
787
+ /** devices.mode on (core/devices.ts devicesOn, read here without it: devices.ts reads this module). A config that cannot be read: off. */
788
+ function devicesModeOn(env) {
789
+ try {
790
+ return loadUserConfig(env).devicesMode === "on";
791
+ }
792
+ catch {
793
+ return false;
794
+ }
795
+ }
796
+ /**
797
+ * The item of the Strom app that shows the QR code, as the phone's page names it: Connect phone, and with the gateway of
798
+ * the devices on (the app 3.32 on) Connect device. Here and not in the catalogs: they say nothing of the gateway while
799
+ * it is off (test devices-quiet). A language not here: as in English.
800
+ */
801
+ const CONNECT_ITEM = {
802
+ en: ["Connect phone", "Connect device"],
803
+ cs: ["Připojit telefon", "Připojit zařízení"],
804
+ de: ["Telefon verbinden", "Gerät verbinden"],
805
+ pl: ["Połącz telefon", "Połącz urządzenie"],
806
+ };
807
+ /**
808
+ * The phone's page (assets/phone/index.html) in a language, its script and style allowed by the nonce alone. `devices`:
809
+ * the gateway of the devices is on (devices.mode) — the app shows the QR code by Connect device, never Connect phone.
810
+ */
811
+ export function phonePage(lang, nonce, opts = {}) {
789
812
  const texts = Object.fromEntries(Object.keys(UI).filter((k) => k.startsWith("ui.phone.page.")).map((k) => [k.slice("ui.phone.page.".length), ui(lang, k)]));
813
+ if (opts.devices)
814
+ for (const [phone, device] of [CONNECT_ITEM[lang] ?? CONNECT_ITEM.en, CONNECT_ITEM.en])
815
+ for (const k of ["expired", "unpaired.how", "unpaired.howHome"])
816
+ if (texts[k])
817
+ texts[k] = texts[k].replaceAll(phone, device);
790
818
  const json = JSON.stringify(texts).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
791
819
  // its style and script inside it, each under the nonce (nothing of them can end its element: our own files)
792
820
  return (readAsset("phone", "index.html") ?? "<!doctype html><title>Strom</title>")
@@ -923,7 +951,7 @@ export function servePhone(env) {
923
951
  "Content-Type": "text/html; charset=utf-8",
924
952
  "Content-Security-Policy": `default-src 'none'; script-src 'nonce-${nonce}'; style-src 'nonce-${nonce}'; worker-src 'self'; child-src 'self'; connect-src 'self'; img-src 'self' data: blob:; base-uri 'none'; form-action 'none'; frame-ancestors 'none'`,
925
953
  });
926
- res.end(phonePage(lang, nonce));
954
+ res.end(phonePage(lang, nonce, { devices: devicesModeOn(env) }));
927
955
  };
928
956
  // what the phone's page sends and asks (phone-send.ts)
929
957
  const send = phoneSend(env, (text) => notePhone(env, text));
@@ -863,10 +863,24 @@ export function appReadsNameStatus(settings, version, gate = APP_READS_NAME_STAT
863
863
  * strom-device/1). Pending: the app has not said its version yet — the gateway serves no copy of it until it does.
864
864
  */
865
865
  export const APP_DEVICE_MODE = undefined;
866
- /** May the gateway serve the copy of the Strom app of this version (downloaded by core/deviceapp.ts)? A gate pending, a version unknown: no. */
867
- export function deviceAppServable(version, gate = APP_DEVICE_MODE) {
866
+ /**
867
+ * The beta of the Strom app that runs on the devices first (its answer: 3.32.0-beta.4): a copy downloaded from the
868
+ * app's beta site (https://beta.stromapp.info) of this version or newer is served before APP_DEVICE_MODE is set — never
869
+ * a copy of the app's site or a development copy.
870
+ */
871
+ export const APP_DEVICE_MODE_BETA = "3.32.0-beta.4";
872
+ /**
873
+ * May the gateway serve the copy of the Strom app of this version (downloaded by core/deviceapp.ts from `from`, the
874
+ * origin of its site)? From the app's beta site: from APP_DEVICE_MODE_BETA; else from APP_DEVICE_MODE. A gate pending,
875
+ * a version unknown: no.
876
+ */
877
+ export function deviceAppServable(version, gate = APP_DEVICE_MODE, from, beta = APP_DEVICE_MODE_BETA) {
868
878
  const v = version?.trim();
869
- return !!gate && !!v && isAppVersion(v) && compareVersions(v, gate) >= 0;
879
+ if (!v || !isAppVersion(v))
880
+ return false;
881
+ if (beta && from === new URL(STROM_APP_BETA_URL).origin && compareVersions(v, beta) >= 0)
882
+ return true;
883
+ return !!gate && compareVersions(v, gate) >= 0;
870
884
  }
871
885
  /** Does a file of the Strom app of this version (its HEAD's 2 VERS) say a citation left out was removed by the user? No version said: no. */
872
886
  export function appSendsUncite(version, gate = APP_SENDS_UNCITE) {
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.37.0-beta.4";
35
+ export const VERSION = "1.37.0-beta.5";
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", "name-status-1"];
38
38
  const GITIGNORE = `# Strom Research — local state and large files are not versioned
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strom-research",
3
- "version": "1.37.0-beta.4",
3
+ "version": "1.37.0-beta.5",
4
4
  "stromDoc": "8940ea14ca510aebcd7f00d2de6f4a64da84de0e",
5
5
  "description": "Genealogical research toolkit for AI coding agents",
6
6
  "type": "module",