strom-research 1.13.2-beta.12 → 1.13.2-beta.13
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/assets/lang/cs.json +112 -23
- package/assets/lang/de.json +112 -23
- package/assets/method/core.md +9 -0
- package/assets/method/locate.md +3 -2
- package/assets/method/reading.md +8 -0
- package/assets/method/request.md +12 -3
- package/assets/method/waiting.md +66 -0
- package/dist/agents/files.js +8 -2
- package/dist/brief/brief.js +23 -3
- package/dist/brief/sheet.js +3 -1
- package/dist/cli/human.js +28 -3
- package/dist/cli/menu-archives.js +73 -76
- package/dist/cli/menu-links.js +90 -1
- package/dist/cli/menu-research.js +1 -1
- package/dist/cli/menu-waiting.js +487 -112
- package/dist/cli/menu.js +6 -8
- package/dist/cli/ui.js +102 -20
- package/dist/commands/archives.js +9 -2
- package/dist/commands/guide.js +8 -2
- package/dist/commands/intake.js +45 -11
- package/dist/commands/links.js +11 -0
- package/dist/commands/media.js +20 -3
- package/dist/commands/meta.js +15 -1
- package/dist/commands/read.js +6 -3
- package/dist/commands/readings.js +25 -5
- package/dist/commands/session.js +18 -1
- package/dist/commands/start.js +37 -5
- package/dist/commands/tasks.js +199 -13
- package/dist/core/archivewait.js +4 -2
- package/dist/core/changelog.js +7 -0
- package/dist/core/conflicts.js +1 -1
- package/dist/core/impersonal.js +69 -0
- package/dist/core/links.js +6 -2
- package/dist/core/live.js +191 -146
- package/dist/core/media.js +2 -0
- package/dist/core/model.js +2 -0
- package/dist/core/originals.js +5 -5
- package/dist/core/phrases.js +9 -2
- package/dist/core/reader.js +19 -2
- package/dist/core/schema.js +4 -1
- package/dist/core/stromapp.js +2 -1
- package/dist/core/taskfiles.js +64 -0
- package/dist/core/tree.js +1 -1
- package/dist/core/waiting.js +350 -0
- package/dist/core/waitkind.js +276 -0
- package/package.json +1 -1
package/dist/cli/menu.js
CHANGED
|
@@ -11,7 +11,6 @@ import path from "node:path";
|
|
|
11
11
|
import { ui } from "./ui.js";
|
|
12
12
|
import { mb, tidyPlan, TIDY_SAID } from "../core/tidy.js";
|
|
13
13
|
import { calibrationLabel, calibrationOffer } from "../core/viewsizes.js";
|
|
14
|
-
import { questionsWaiting } from "../core/tuneask.js";
|
|
15
14
|
/** A line as a sentence: its first letter capital (a catalog's text that also stands inside a line). */
|
|
16
15
|
const sentence = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
17
16
|
import { newerTree, Tree, VERSION } from "../core/tree.js";
|
|
@@ -21,7 +20,7 @@ import { diskVersion } from "../core/self.js";
|
|
|
21
20
|
import { liveHolder } from "../core/lock.js";
|
|
22
21
|
import { reviveLive } from "../core/live.js";
|
|
23
22
|
import { newerVersion } from "../core/update.js";
|
|
24
|
-
import { taskQueue
|
|
23
|
+
import { taskQueue } from "../commands/tasks.js";
|
|
25
24
|
import { humanTask } from "../commands/browse.js";
|
|
26
25
|
import { loadGate } from "../core/gate.js";
|
|
27
26
|
import { lacksImages } from "../core/queue.js";
|
|
@@ -39,8 +38,7 @@ import { packPlan } from "../core/pack.js";
|
|
|
39
38
|
import { expandHome, isolated } from "../core/paths.js";
|
|
40
39
|
import { offerAgent } from "./fixes.js";
|
|
41
40
|
import { addToResearch } from "./menu-research.js";
|
|
42
|
-
import { waitingForYou } from "./menu-waiting.js";
|
|
43
|
-
import { archiveQuestionCount } from "./menu-archives.js";
|
|
41
|
+
import { waitingForYou, waitingHere } from "./menu-waiting.js";
|
|
44
42
|
import { permissionWaitingLines } from "../core/archiveasks.js";
|
|
45
43
|
import { settingsMenu } from "./menu-settings.js";
|
|
46
44
|
import { mainPerson } from "../core/kin.js";
|
|
@@ -48,8 +46,7 @@ import { findAgent } from "../core/which.js";
|
|
|
48
46
|
import { agentsHere, waysHere, whereToTalk } from "../core/apps.js";
|
|
49
47
|
import { chooseWay, wayName } from "./ways.js";
|
|
50
48
|
import { PROFILES } from "../agents/profiles.js";
|
|
51
|
-
import { forStory
|
|
52
|
-
import { receivedPending } from "../core/sync.js";
|
|
49
|
+
import { forStory } from "../core/stories.js";
|
|
53
50
|
import { isArchive } from "../core/mode.js";
|
|
54
51
|
import { switchTo } from "./menu-mode.js";
|
|
55
52
|
import { appMarkFromInstall, linkScheme } from "../core/links.js";
|
|
@@ -167,8 +164,9 @@ export async function runMenu(ctx, run) {
|
|
|
167
164
|
// its next start brings it back
|
|
168
165
|
}
|
|
169
166
|
}
|
|
170
|
-
//
|
|
171
|
-
|
|
167
|
+
// what waits for the person: the same list What waits shows (each thing once — a task that waits for an archive's
|
|
168
|
+
// decision is one of its question's)
|
|
169
|
+
const waiting = waitingHere(ctx, tree).length;
|
|
172
170
|
const started = tree.list("research").length > 0;
|
|
173
171
|
out(t("ui.menu.tree", { name: tree.config.name, persons: tree.countLive("person") }));
|
|
174
172
|
// No agent yet (none installed, or not the one chosen): the research waits for it, and item 1 gets one.
|
package/dist/cli/ui.js
CHANGED
|
@@ -88,6 +88,8 @@ export const UI = {
|
|
|
88
88
|
"ui.chat.open": "Opening the conversation with the agent ({agent}). To end it, type {exit}.",
|
|
89
89
|
"ui.chat.first": "Hello, I want to start researching my ancestors. Run `strom`, explain to me in a few sentences how we will work together, and ask me whom we are looking for and what we already know.",
|
|
90
90
|
"ui.chat.continue": "Let's continue the research. Run `strom`, tell me briefly where the research stands and what waits for me, and suggest what to do next.",
|
|
91
|
+
"ui.chat.task.say": "Let us take up task {task}: {what} It waits for: {on} ({group}). Run `strom task show {task}` and `strom guide waiting`, then lead me through it step by step.",
|
|
92
|
+
"ui.chat.task.more.say": "Along with it, the other tasks waiting at the same place: {tasks} — run `strom task show` for each of them too.",
|
|
91
93
|
"ui.setup.welcome": "Welcome to Strom research. Let's set up a few things — press Enter to accept the suggested answer.",
|
|
92
94
|
"ui.setup.again": "Settings — press Enter to keep the current value.",
|
|
93
95
|
"ui.setup.lang": "Language (cs, en, de, pl, …)",
|
|
@@ -196,7 +198,6 @@ export const UI = {
|
|
|
196
198
|
"ui.tune.q.c.keep": "Keep it",
|
|
197
199
|
"ui.o.tune": "{n} question(s) about reading them wait for a person's decision: strom media calibrate --questions",
|
|
198
200
|
"ui.waiting.tune": "A question about the reading of scans: {text}",
|
|
199
|
-
"ui.waiting.tune.read": "Decide {k}: the reading of scans",
|
|
200
201
|
"ui.tune.title": "Reading of scans · {agent} · {days} days since {since} — from this research's own records, free",
|
|
201
202
|
"ui.tune.none": "Reading of scans · {agent}: nothing measured yet — the figures come from the sessions of strom run and the readers of strom read.",
|
|
202
203
|
"ui.tune.noscans": "Reading of scans · {agent}: no scans read here yet (sessions {sessions}).",
|
|
@@ -412,6 +413,85 @@ export const UI = {
|
|
|
412
413
|
"ui.wait.save": "save them into {dir}",
|
|
413
414
|
"ui.wait.how1": "scans go into the inbox, a folder per book, each named by its image number as the viewer counts it",
|
|
414
415
|
"ui.wait.how2": "(9.jpg; a zoomed-in part of it: 9a.jpg) — the next run registers them and the task comes back by itself",
|
|
416
|
+
"ui.wait.todo.n": "to do {n}",
|
|
417
|
+
"ui.wait.sent.n": "waiting for a reply {n}",
|
|
418
|
+
"ui.wait.sent.title": "Waiting for a reply",
|
|
419
|
+
"ui.wait.filter": "filter: {section}",
|
|
420
|
+
"ui.wait.none.todo": "Nothing to do now.",
|
|
421
|
+
"ui.wait.sec.decide": "decisions",
|
|
422
|
+
"ui.wait.sec.images": "images",
|
|
423
|
+
"ui.wait.sec.letter": "archives and offices",
|
|
424
|
+
"ui.wait.sec.family": "family",
|
|
425
|
+
"ui.wait.sec.web": "web",
|
|
426
|
+
"ui.wait.sec.other": "other",
|
|
427
|
+
"ui.wait.key.decide": "d",
|
|
428
|
+
"ui.wait.key.images": "i",
|
|
429
|
+
"ui.wait.key.letter": "o",
|
|
430
|
+
"ui.wait.key.family": "f",
|
|
431
|
+
"ui.wait.key.web": "w",
|
|
432
|
+
"ui.wait.key.other": "x",
|
|
433
|
+
"ui.wait.key.next": "n",
|
|
434
|
+
"ui.wait.key.prev": "p",
|
|
435
|
+
"ui.wait.key.all": "a",
|
|
436
|
+
"ui.wait.kind.images": "images",
|
|
437
|
+
"ui.wait.kind.letter": "letter",
|
|
438
|
+
"ui.wait.kind.family": "family",
|
|
439
|
+
"ui.wait.kind.web": "web",
|
|
440
|
+
"ui.wait.kind.check": "a site to check",
|
|
441
|
+
"ui.wait.kind.permission": "an archive's permission",
|
|
442
|
+
"ui.wait.kind.takeover": "downloaders to confirm",
|
|
443
|
+
"ui.wait.kind.milder": "milder terms",
|
|
444
|
+
"ui.wait.kind.story": "story",
|
|
445
|
+
"ui.wait.kind.send": "from the Strom app",
|
|
446
|
+
"ui.wait.kind.tune": "the reading of scans",
|
|
447
|
+
"ui.wait.kind.other": "other",
|
|
448
|
+
"ui.wait.letter.todo": "a letter to send",
|
|
449
|
+
"ui.wait.family.todo": "a message to send",
|
|
450
|
+
"ui.wait.ago.today": "today",
|
|
451
|
+
"ui.wait.ago.one": "1 day ago",
|
|
452
|
+
"ui.wait.ago": "{n} days ago",
|
|
453
|
+
"ui.wait.sentline": "sent {day} · {ago}",
|
|
454
|
+
"ui.wait.noreply": "no reply for over {days} days",
|
|
455
|
+
"ui.wait.c.page": "Page {page}/{pages}",
|
|
456
|
+
"ui.wait.c.shown": "{from}–{to} of {n}",
|
|
457
|
+
"ui.wait.c.number": "number = group",
|
|
458
|
+
"ui.wait.c.next": "{key} next",
|
|
459
|
+
"ui.wait.c.prev": "{key} previous",
|
|
460
|
+
"ui.wait.c.all": "{key} all",
|
|
461
|
+
"ui.wait.c.filter": "{keys} filter",
|
|
462
|
+
"ui.wait.c.sent": "? waiting for a reply",
|
|
463
|
+
"ui.wait.c.todo": "? to do",
|
|
464
|
+
"ui.wait.c.back": "0 back",
|
|
465
|
+
"ui.wait.c.unfilter": "0 without the filter",
|
|
466
|
+
"ui.wait.group.text": "The text of all requests at once",
|
|
467
|
+
"ui.wait.group.sent": "Sent for the whole group",
|
|
468
|
+
"ui.wait.group.sent.list": "Requests to mark as sent ({place}):",
|
|
469
|
+
"ui.wait.group.sent.sure": "Mark them as sent? They still wait for the reply.",
|
|
470
|
+
"ui.wait.group.sent.done": "✓ Marked as sent: {ids} — they still wait for the reply.",
|
|
471
|
+
"ui.wait.group.chat": "A conversation with the agent about the whole group",
|
|
472
|
+
"ui.wait.prio": "priority {n}",
|
|
473
|
+
"ui.wait.since": "since {day}",
|
|
474
|
+
"ui.wait.text.none": "No request text is saved here.",
|
|
475
|
+
"ui.wait.text.head": "The request text to copy ({files}):",
|
|
476
|
+
"ui.wait.d.on": "Waits for: {on}",
|
|
477
|
+
"ui.wait.d.to": "To: {to}",
|
|
478
|
+
"ui.wait.d.place": "Where: {place}",
|
|
479
|
+
"ui.wait.d.since": "Waiting since {day}",
|
|
480
|
+
"ui.wait.url": "The link: {url}",
|
|
481
|
+
"ui.wait.a.answer": "Answer in words",
|
|
482
|
+
"ui.wait.a.file": "Add a file",
|
|
483
|
+
"ui.wait.a.archive": "Open the archive",
|
|
484
|
+
"ui.wait.a.folder": "Open the folder ({have}/{want} saved)",
|
|
485
|
+
"ui.wait.a.cannot": "It does not work — write why",
|
|
486
|
+
"ui.wait.cannot.write": "What does not work, briefly (Enter or 0 goes back)",
|
|
487
|
+
"ui.wait.a.unsent": "Back among what is to do",
|
|
488
|
+
"ui.wait.unsent.done": "✓ Back among what is to do.",
|
|
489
|
+
"ui.wait.a.note": "The request's text",
|
|
490
|
+
"ui.wait.a.sent": "Sent",
|
|
491
|
+
"ui.wait.a.web": "Open the site",
|
|
492
|
+
"ui.wait.a.link": "Open the link",
|
|
493
|
+
"ui.wait.a.chat": "A conversation with the agent",
|
|
494
|
+
"ui.wait.sent.sure": "Mark the request as sent{to}? The task still waits for the reply.",
|
|
415
495
|
"ui.run.summary": "{n} session(s) · stopped: {reason}",
|
|
416
496
|
"ui.run.stop.done": "done",
|
|
417
497
|
"ui.run.stop.user": "by hand",
|
|
@@ -1233,6 +1313,19 @@ export const UI = {
|
|
|
1233
1313
|
"ui.link.task.park.done": "✓ The task is put aside.",
|
|
1234
1314
|
"ui.link.task.drop.done": "✓ The task is given up (kept, with the reason).",
|
|
1235
1315
|
"ui.link.task.wake.done": "✓ The task is back in the agent's queue.",
|
|
1316
|
+
"ui.link.task.sent.done": "✓ Marked as sent — the task still waits for the reply.",
|
|
1317
|
+
"ui.link.what.task.chat": "a conversation with the agent ({agent}) about the task: {what}",
|
|
1318
|
+
"ui.link.what.task.chat.more": " — with {n} more task(s) waiting at the same place",
|
|
1319
|
+
"ui.link.what.task.sent": "marking the request of a task as sent{to} — the task still waits for the reply: {what}",
|
|
1320
|
+
"ui.link.sent.cannot": "Task {task} waits for no request to send (a letter, the family, other). Nothing was done.",
|
|
1321
|
+
"ui.link.sent.already": "Task {task} is marked as sent already ({day}). Nothing was done.",
|
|
1322
|
+
"ui.link.note.none": "Task {task} has no request text saved. Nothing was done.",
|
|
1323
|
+
"ui.link.note.opened": "The request text: {file}",
|
|
1324
|
+
"ui.link.folder.none": "Task {task} waits for no images saved by hand. Nothing was done.",
|
|
1325
|
+
"ui.link.what.task.file": "a file for the task — it goes back into the agent's queue: {what}",
|
|
1326
|
+
"ui.link.file.cannot": "Task {task} takes no file now (it waits for a check of a site or a decision about an archive). Nothing was done.",
|
|
1327
|
+
"ui.link.file.note": "A short note to the file (Enter: none, 0: back)",
|
|
1328
|
+
"ui.link.task.file.done": "✓ The file is with the task — the task is back in the agent's queue.",
|
|
1236
1329
|
"ui.link.sessions.title": "The agent's sessions — {name}",
|
|
1237
1330
|
"ui.link.sessions.none": "The agent has not worked on this research yet.",
|
|
1238
1331
|
"ui.link.sessions.month": "This month: {n} sessions, {cost}",
|
|
@@ -1403,16 +1496,12 @@ export const UI = {
|
|
|
1403
1496
|
"ui.menu.update.where": "A new version of strom is out: {version} — update it in the settings (item {key}) → Maintenance.",
|
|
1404
1497
|
"ui.more.noagent": "The agent takes it up once it is on this computer (item 1 of the menu).",
|
|
1405
1498
|
"ui.menu.noagent.chosen": "The AI agent this research uses is not on this computer — item 1 chooses another.",
|
|
1406
|
-
"ui.waiting.title": "The agent waits for {n} thing(s):",
|
|
1407
1499
|
"ui.waiting.do": "What to do: {what}",
|
|
1408
1500
|
"ui.waiting.ask": "the agent says it in a conversation",
|
|
1409
1501
|
"ui.waiting.images": "Save by hand: images {images} of {book}",
|
|
1410
|
-
"ui.waiting.more": "…and {n} more — the agent goes through them in a conversation.",
|
|
1411
|
-
"ui.waiting.pick": "Something found? Choose the number and write what was found:",
|
|
1412
|
-
"ui.waiting.answer": "Answer {k}: {what}",
|
|
1413
|
-
"ui.waiting.folder": "Open the folder for the images of {k}",
|
|
1414
1502
|
"ui.waiting.opened": "The folder: {dir} — once the images are there, the next work of the agent takes them in by itself.",
|
|
1415
1503
|
"ui.waiting.write": "The answer — a link, a book's number, what was found out (Enter or 0 goes back)",
|
|
1504
|
+
"ui.waiting.later": "The answer is kept with the task; the agent takes it up in its next work.",
|
|
1416
1505
|
"ui.waiting.check": "To check at the link: {ask}",
|
|
1417
1506
|
"ui.waiting.check.why": "The site does not let automated tools in – only a person sees it.",
|
|
1418
1507
|
"ui.waiting.check.pick": "What is there?",
|
|
@@ -1422,9 +1511,6 @@ export const UI = {
|
|
|
1422
1511
|
"ui.waiting.check.note": "A note for the research (Enter: none)",
|
|
1423
1512
|
"ui.waiting.check.open": "Open the link in the browser?",
|
|
1424
1513
|
"ui.task.answer.window": "Write to task {task} the answer: “{answer}”?",
|
|
1425
|
-
"ui.waiting.back": "✓ The task goes back to the agent with the answer.",
|
|
1426
|
-
"ui.waiting.chat": "Go on with the agent now?",
|
|
1427
|
-
"ui.waiting.say": "I answered what you asked of me: {what} — let us go on with it.",
|
|
1428
1514
|
"ui.intake.empty": "There is nothing in it to take in.",
|
|
1429
1515
|
"ui.intake.ours": "{path} is strom's own folder (the research itself), not material of the family.",
|
|
1430
1516
|
"ui.research.exists": "This research is there already: “{name}” — the agent goes on with it.",
|
|
@@ -1503,15 +1589,11 @@ export const UI = {
|
|
|
1503
1589
|
"ui.story.new.taken": "✓ The new version is the story now, approved. Open the research in the Strom app again and it is there.",
|
|
1504
1590
|
"ui.story.new.kept": "✓ The approved story stays; the new version is gone (the history of the research keeps it).",
|
|
1505
1591
|
"ui.waiting.story": "A new version of the story of {who} — the approved one stays until a decision",
|
|
1506
|
-
"ui.waiting.story.read": "Read the new story of {who} and decide",
|
|
1507
|
-
"ui.waiting.title.sent": "Waiting ({n}):",
|
|
1508
1592
|
"ui.waiting.sent": "The Strom app sent the tree ({day}, {time}): {n} change(s) to write into the research or throw away",
|
|
1509
|
-
"ui.waiting.sent.read": "See what the tree from the Strom app ({k}) brings and decide",
|
|
1510
1593
|
"ui.sent.discard": "Throw it away: nothing of it is written",
|
|
1511
1594
|
"ui.sent.later": "Leave it waiting",
|
|
1512
1595
|
"ui.sent.why": "Why? The Strom app shows it (Enter: no reason, 0: back):",
|
|
1513
1596
|
"ui.sent.discarded.app": "The Strom app shows the send as thrown away; the edits stay in it and can be sent again.",
|
|
1514
|
-
"ui.waiting.pick.story": "Choose the number:",
|
|
1515
1597
|
"ui.trees.pack": "pack \"{name}\" to send to someone (a ZIP file)",
|
|
1516
1598
|
"ui.trees.unpack": "a family tree from someone else (a ZIP file)",
|
|
1517
1599
|
"ui.pack.which": "Which images go along?",
|
|
@@ -1789,8 +1871,8 @@ export const UI = {
|
|
|
1789
1871
|
"ui.archive.terms.robots": "Its robots.txt: “{quote}” ({terms}) – no automated access other than through a person's browser.",
|
|
1790
1872
|
"ui.archive.terms.robots.none": "Its robots.txt allows no automated access ({terms}) – only through a person's browser.",
|
|
1791
1873
|
"ui.archive.name": "{title} ({host})",
|
|
1792
|
-
"ui.archive.ask.slow": "Allow slow downloading of its images? At most one image every {seconds} s and
|
|
1793
|
-
"ui.archive.ask.browser": "Allow downloading its images through the browser on this computer? Chrome with the Claude extension; strom plans the pace (at most one image every {seconds} s,
|
|
1874
|
+
"ui.archive.ask.slow": "Allow slow downloading of its images? At most one image every {seconds} s and {cap}, only the images a task needs, nothing in advance. Without permission the images are saved by hand into a folder made ready for them.",
|
|
1875
|
+
"ui.archive.ask.browser": "Allow downloading its images through the browser on this computer? Chrome with the Claude extension; strom plans the pace (at most one image every {seconds} s, {cap}); a check whether a person is there is passed by the person, never by strom. Without permission the images are saved by hand.",
|
|
1794
1876
|
"ui.archive.ask.change": "For this archive on this computer; to be changed at any time: strom allow archive {host}.",
|
|
1795
1877
|
"ui.archive.btn.slow": "Allow slowly",
|
|
1796
1878
|
"ui.archive.btn.browser": "Allow through the browser",
|
|
@@ -1806,7 +1888,9 @@ export const UI = {
|
|
|
1806
1888
|
"ui.archive.window.browser": "Download through the browser, one image every {seconds} s, only what a task needs?",
|
|
1807
1889
|
"ui.archive.window.change": "To change: settings → Archives.",
|
|
1808
1890
|
"ui.archive.choose": "{title} – how to get its images?",
|
|
1809
|
-
"ui.archive.way.slow": "Slowly, at a person's pace (one image at most every {seconds} s,
|
|
1891
|
+
"ui.archive.way.slow": "Slowly, at a person's pace (one image at most every {seconds} s, {cap}, only what a task needs)",
|
|
1892
|
+
"ui.archive.cap": "at most {n} requests to the archive an hour, its catalogue counted too",
|
|
1893
|
+
"ui.archive.cap.short": "at most {n} requests an hour, the catalogue too",
|
|
1810
1894
|
"ui.archive.way.browser": "Through the browser on this computer (Chrome with the Claude extension; strom plans the pace)",
|
|
1811
1895
|
"ui.archive.way.manual": "By hand only – the images are saved into a folder made ready",
|
|
1812
1896
|
"ui.archive.way.later": "Later – nothing changes",
|
|
@@ -1821,9 +1905,7 @@ export const UI = {
|
|
|
1821
1905
|
"ui.archive.item": "Downloading images from the archive {title} ({host})",
|
|
1822
1906
|
"ui.archive.item.tasks": "Tasks waiting for it: {ids}",
|
|
1823
1907
|
"ui.archive.item.since": "Waiting since {date} · download attempts: {tries}",
|
|
1824
|
-
"ui.archive.item.read": "Decide {k}: images from {title}",
|
|
1825
1908
|
"ui.archive.takeover.item": "The levels of the downloaders taken over from the earlier version, to be confirmed ({n}): {names}",
|
|
1826
|
-
"ui.archive.takeover.read": "Confirm or go through {k}: the downloaders taken over",
|
|
1827
1909
|
"ui.archive.takeover.about": "Until confirmed they download as before. Each as its downloader reads the archive's terms:",
|
|
1828
1910
|
"ui.archive.takeover.line": "{title} ({hosts}): {level}",
|
|
1829
1911
|
"ui.archive.takeover.all": "Confirm all",
|
|
@@ -1835,7 +1917,6 @@ export const UI = {
|
|
|
1835
1917
|
"ui.archive.takeover.manual": "Stricter: images by hand only",
|
|
1836
1918
|
"ui.archive.takeover.stop": "Back \u2013 the rest stay as they are",
|
|
1837
1919
|
"ui.archive.milder.item": "{title} ({host}) now says the archive allows more: {to} (what holds: {from})",
|
|
1838
|
-
"ui.archive.milder.read": "Decide {k}: {title} says the archive allows more",
|
|
1839
1920
|
"ui.archive.milder.accept": "Accept the new reading",
|
|
1840
1921
|
"ui.archive.milder.keep": "Keep what holds now",
|
|
1841
1922
|
"ui.archive.milder.accepted": "\u2713 {title}: the new reading holds.",
|
|
@@ -1848,11 +1929,12 @@ export const UI = {
|
|
|
1848
1929
|
"ui.archive.woken": "Tasks {ids} go back to the queue.",
|
|
1849
1930
|
"ui.archive.inbox": "{id}: images already in its folder ({n}) \u2013 the research registers them and the task comes back by itself.",
|
|
1850
1931
|
"ui.archive.manual.tasks": "Tasks {ids} keep waiting for the images saved by hand.",
|
|
1851
|
-
"ui.archive.pace": "one image at most every {seconds} s,
|
|
1932
|
+
"ui.archive.pace": "one image at most every {seconds} s, {cap}",
|
|
1852
1933
|
"ui.archive.pace.line": "Pace of its images, slowly: {pace} \u2013 changed only by a command: strom allow host {host} --pace <s> --per-hour <n>, for every archive strom config set archive.pace \"<s> <n>\"",
|
|
1853
1934
|
"ui.archive.allowed.line": "What holds: {level} – here only stricter: its images by hand.",
|
|
1854
1935
|
"ui.archive.pace.service": "Pace of its images: {pace} – changed only by a command: strom allow host {host} --pace <s> --per-hour <n>",
|
|
1855
1936
|
"ui.archive.closed": "{title}: {level}. A permission does not change that; only a command lifts its level: strom allow archive {host} --level restricted",
|
|
1937
|
+
"ui.archive.closed.hand": "{title}: {level}. Its images go only by hand: saved in the browser into the task's folder in the inbox.",
|
|
1856
1938
|
"ui.archive.gone": "No downloader here reaches this archive any more \u2013 nothing to decide.",
|
|
1857
1939
|
"ui.archive.level.allowed": "downloading allowed by its terms",
|
|
1858
1940
|
"ui.archive.level.restricted": "its terms restrict automated downloading \u2013 images only with permission",
|
|
@@ -221,6 +221,13 @@ function termsLine(lang, a) {
|
|
|
221
221
|
return ui(lang, "ui.archive.terms.connector", { quote: a.quote, terms: a.terms ?? "" });
|
|
222
222
|
return ui(lang, "ui.archive.terms.none");
|
|
223
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* An hourly cap in the person's words: "at most 120 requests to the archive an hour, its catalogue counted too" (`short`:
|
|
226
|
+
* "at most 120 requests an hour, the catalogue too"), or "no hourly cap".
|
|
227
|
+
*/
|
|
228
|
+
export function capWords(lang, perHour, short = false) {
|
|
229
|
+
return typeof perHour === "number" && Number.isFinite(perHour) && perHour > 0 ? ui(lang, short ? "ui.archive.cap.short" : "ui.archive.cap", { n: perHour }) : ui(lang, "ui.pace.nocap");
|
|
230
|
+
}
|
|
224
231
|
/** The question of a permission, in the person's language: the archive, its terms, the pace, how to change it. */
|
|
225
232
|
export function permissionText(ctx, a, way, c) {
|
|
226
233
|
const lang = ctx.uiLang();
|
|
@@ -228,7 +235,7 @@ export function permissionText(ctx, a, way, c) {
|
|
|
228
235
|
return [
|
|
229
236
|
ui(lang, "ui.archive.name", { title: a.title ?? a.host, host: a.host }),
|
|
230
237
|
termsLine(lang, a),
|
|
231
|
-
ui(lang, way === "browser" ? "ui.archive.ask.browser" : "ui.archive.ask.slow", { seconds: secondsIn(lang, p.minIntervalMs),
|
|
238
|
+
ui(lang, way === "browser" ? "ui.archive.ask.browser" : "ui.archive.ask.slow", { seconds: secondsIn(lang, p.minIntervalMs), cap: capWords(lang, p.perHour) }),
|
|
232
239
|
ui(lang, "ui.archive.ask.change", { host: a.host }),
|
|
233
240
|
].join("\n\n");
|
|
234
241
|
}
|
|
@@ -294,7 +301,7 @@ async function askPerson(ctx, c, missing, way) {
|
|
|
294
301
|
// the person in their own terminal: the choice right here, the ways the menu offers (Enter: later, nothing changes)
|
|
295
302
|
if (ctx.interactive && !agentRuns(ctx)) {
|
|
296
303
|
ctx.io.stdout(`\n${question}\n`);
|
|
297
|
-
const labels = ways.map((w) => ({ label: ui(lang, w === "slow" ? "ui.archive.way.slow" : w === "browser" ? "ui.archive.way.browser" : "ui.archive.way.manual", { seconds: secondsIn(lang, p.minIntervalMs),
|
|
304
|
+
const labels = ways.map((w) => ({ label: ui(lang, w === "slow" ? "ui.archive.way.slow" : w === "browser" ? "ui.archive.way.browser" : "ui.archive.way.manual", { seconds: secondsIn(lang, p.minIntervalMs), cap: capWords(lang, p.perHour) }) }));
|
|
298
305
|
const i = await ctx.choose(ui(lang, "ui.archive.choose", { title: a.title ?? a.host }), labels, labels.length, { back: ui(lang, "ui.archive.way.later") });
|
|
299
306
|
if (i !== undefined && ways[i]) {
|
|
300
307
|
const chosen = ways[i];
|
package/dist/commands/guide.js
CHANGED
|
@@ -73,12 +73,18 @@ conversation opened anywhere, a bot on its own server)
|
|
|
73
73
|
(or task wait T… --on "…"), then strom session close --summary "…" --next "…"
|
|
74
74
|
What a task waits for (strom task wait T… --on "…") the user reads in strom's menu and the Strom app:
|
|
75
75
|
write it in the research language, impersonal — what is needed, never addressed to them ("Images
|
|
76
|
-
40–45 of the baptisms to be saved from <link>", not "Open … and save …")
|
|
76
|
+
40–45 of the baptisms to be saved from <link>", not "Open … and save …"), nor in your voice ("please",
|
|
77
|
+
"I will then…"). Say its kind (--kind letter|family|web|other) and, when known, whom it waits on (--to),
|
|
78
|
+
the request's text saved in notes/ (--request notes/<file>.md), the site (--url); strom task sent T…
|
|
79
|
+
once the user says the request went out (the task still waits for the reply).
|
|
80
|
+
A conversation that begins with a waiting task (strom chat --task T…: the user picked it in the menu
|
|
81
|
+
or the Strom app) leads the user through it and the tasks waiting at the same place: strom guide waiting.
|
|
77
82
|
then, in a conversation, tell the user what was found (strom person card …) and what comes next
|
|
78
83
|
(strom plan), and ask before the next session; working alone (strom run) nobody reads the session
|
|
79
84
|
live and the summary is what they read (plain words of the research for the record, never addressed
|
|
80
85
|
to them) — nothing more after it, no advice to clear the context (/clear) or to start anything,
|
|
81
|
-
nothing said to the user
|
|
86
|
+
nothing said to the user: every message there, the last one too, in the research language and
|
|
87
|
+
impersonal (they may read the run afterwards); nobody answers a question there: what only the user can decide waits for
|
|
82
88
|
them (strom task wait T… --on "<the question, impersonal>": the menu's What waits for you, the Strom
|
|
83
89
|
app; their answer comes back on the task). The next step is strom's queue: what the user wants instead becomes a
|
|
84
90
|
task first (strom task add …, or strom research new …) — never search outside a session and its task.
|
package/dist/commands/intake.js
CHANGED
|
@@ -18,6 +18,7 @@ import { safeFolderName } from "../core/text.js";
|
|
|
18
18
|
import { amendInput, checkOriginalMeta } from "../core/originals.js";
|
|
19
19
|
import { batchStatus, closeBatch, listBatches, readBatch } from "../core/batches.js";
|
|
20
20
|
import { SORT_KINDS } from "../core/model.js";
|
|
21
|
+
import { fileBy, handFiles, taskForFile, taskPeople } from "../core/taskfiles.js";
|
|
21
22
|
function kindOf(file, text) {
|
|
22
23
|
const ext = path.extname(file).toLowerCase();
|
|
23
24
|
if (ext === ".ged")
|
|
@@ -81,7 +82,10 @@ register({
|
|
|
81
82
|
lock: "sections",
|
|
82
83
|
description: "Every file is registered unchanged as an input (duplicates skipped) and gets an intake task.\n" +
|
|
83
84
|
`Files up to ${MAX_IN_TREE / 1024 / 1024} MB are kept in the tree (and its history); bigger ones in shared/media.\n` +
|
|
84
|
-
"Family trees are imported at once — every person and fact as a lead citing that tree
|
|
85
|
+
"Family trees are imported at once — every person and fact as a lead citing that tree.\n" +
|
|
86
|
+
"--answers T…: the files came for what that waiting task waits for (a reply, a document asked for): inputs of its\n" +
|
|
87
|
+
"people, handed to the task, which goes back into the queue — no intake task of their own. Only that the files came\n" +
|
|
88
|
+
"is written, never words as the user's (their answer in words: strom task wake T… --answer).",
|
|
85
89
|
args: [{ name: "paths", description: "files or folders", variadic: true }],
|
|
86
90
|
options: [
|
|
87
91
|
{ name: "text", type: "string", value: "<text>", description: "what the user tells you, as an input of its own" },
|
|
@@ -89,14 +93,30 @@ register({
|
|
|
89
93
|
{ name: "documents", type: "boolean", description: `a folder with more than ${BOOK_OF_SCANS} images really is family documents (not scans of a book)` },
|
|
90
94
|
{ name: "research", type: "string", value: "<G…>", description: "the research it is for (default: the only active one)" },
|
|
91
95
|
{ name: "person", type: "string", multiple: true, value: "<P…>", description: "the person it is of, as the user says (repeatable): its task is shown with them" },
|
|
96
|
+
{ name: "answers", type: "string", value: "<T…>", description: "the files came for what this waiting task waits for: handed to it, the task back in the queue (no intake task)" },
|
|
97
|
+
{ name: "note", type: "string", value: "<text>", description: "what the user says of the files, kept with them (a sentence)" },
|
|
98
|
+
],
|
|
99
|
+
examples: [
|
|
100
|
+
'strom intake ~/Downloads/rodina',
|
|
101
|
+
"strom intake strom-export.json",
|
|
102
|
+
'strom intake --text "Děda Jan, narozen asi 1905 v Týnci, byl mlynář"',
|
|
103
|
+
"strom intake ~/Downloads/rodina/dopis.txt --research G0001",
|
|
104
|
+
'strom intake ~/Downloads/reply.pdf --answers T0005 --note "the reply of the registry office"',
|
|
92
105
|
],
|
|
93
|
-
examples: ['strom intake ~/Downloads/rodina', "strom intake strom-export.json", 'strom intake --text "Děda Jan, narozen asi 1905 v Týnci, byl mlynář"', "strom intake ~/Downloads/rodina/dopis.txt --research G0001"],
|
|
94
106
|
run(ctx, { args, opts }) {
|
|
95
107
|
const tree = ctx.tree();
|
|
96
108
|
if (args.length === 0 && !opts.text)
|
|
97
109
|
throw new UsageError("give files/folders or --text");
|
|
98
|
-
|
|
99
|
-
const
|
|
110
|
+
// files for what a waiting task waits for: the task's people, handed to it — never words as the user's
|
|
111
|
+
const answers = typeof opts.answers === "string" ? opts.answers.trim() : undefined;
|
|
112
|
+
if (answers !== undefined && typeof opts.text === "string")
|
|
113
|
+
throw new UsageError("--answers takes files — the user's answer in words is theirs alone", { hint: `strom task wake ${answers || "T…"} --answer "…" (the user, in their terminal or strom's menu)` });
|
|
114
|
+
if (answers !== undefined && !args.length)
|
|
115
|
+
throw new UsageError("give the files that came for the task", { hint: `strom intake <file> --answers ${answers || "T…"}` });
|
|
116
|
+
const forTask = answers !== undefined ? taskForFile(tree, answers) : undefined;
|
|
117
|
+
const note = typeof opts.note === "string" ? opts.note.replace(/[\p{Cc}]/gu, " ").trim().slice(0, 500) || undefined : undefined;
|
|
118
|
+
const research = forTask?.research ?? researchFor(tree, opts.research);
|
|
119
|
+
const persons = checkOriginalMeta(tree, { persons: [...(forTask ? taskPeople(tree, forTask) : []), ...(Array.isArray(opts.person) ? opts.person : opts.person ? [opts.person] : []).map((p) => String(p).trim().toUpperCase())] }).persons;
|
|
100
120
|
// Files per argument: a folder becomes one intake task, not one per file.
|
|
101
121
|
const groups = args.map((a) => {
|
|
102
122
|
const p = ctx.resolvePath(a);
|
|
@@ -111,10 +131,13 @@ register({
|
|
|
111
131
|
});
|
|
112
132
|
return { folder: folder ? path.basename(p) : undefined, files };
|
|
113
133
|
});
|
|
114
|
-
const known = new
|
|
134
|
+
const known = new Map(tree.list("input").filter((i) => i.sha).map((i) => [i.sha, i.id]));
|
|
115
135
|
const report = [];
|
|
116
136
|
const added = [];
|
|
137
|
+
/** What came for the task: the new inputs, and those the research had of the same content. */
|
|
138
|
+
const handed = [];
|
|
117
139
|
let skipped = 0;
|
|
140
|
+
let task;
|
|
118
141
|
tree.withTreeLock(() => {
|
|
119
142
|
for (const group of groups) {
|
|
120
143
|
const plain = [];
|
|
@@ -122,9 +145,10 @@ register({
|
|
|
122
145
|
const sha = fileSha256(file);
|
|
123
146
|
if (known.has(sha)) {
|
|
124
147
|
skipped++;
|
|
148
|
+
if (forTask)
|
|
149
|
+
handed.push(known.get(sha));
|
|
125
150
|
continue;
|
|
126
151
|
}
|
|
127
|
-
known.add(sha);
|
|
128
152
|
const size = fs.statSync(file).size;
|
|
129
153
|
const isText = size < 50 * 1024 * 1024 && [".ged", ".json", ".txt", ".md", ".csv"].includes(path.extname(file).toLowerCase());
|
|
130
154
|
const text = isText ? fs.readFileSync(file, "utf8") : undefined;
|
|
@@ -141,7 +165,8 @@ register({
|
|
|
141
165
|
}
|
|
142
166
|
else
|
|
143
167
|
stored = `media:${path.relative(ctx.settings.shared().value, tree.dryRun ? file : storeShared(ctx.settings.shared().value, file, sha))}`;
|
|
144
|
-
const input = create(tree, "input", { name: path.basename(file), file: stored, sha, size, mime: mimeOf(file), from: ctx.display(file), kind, state: "new", ...(persons.length ? { persons } : {}) }, (iid) => `+${iid} input ${kind} "${truncate(path.basename(file), 50)}"`);
|
|
168
|
+
const input = create(tree, "input", { name: path.basename(file), file: stored, sha, size, mime: mimeOf(file), from: ctx.display(file), kind, state: "new", ...(persons.length ? { persons } : {}), ...(note ? { note } : {}) }, (iid) => `+${iid} input ${kind} "${truncate(path.basename(file), 50)}"`);
|
|
169
|
+
known.set(sha, input.id);
|
|
145
170
|
let imported;
|
|
146
171
|
if (kind === "tree" && !opts["no-import"] && text !== undefined) {
|
|
147
172
|
imported = path.extname(file).toLowerCase() === ".ged"
|
|
@@ -162,8 +187,10 @@ register({
|
|
|
162
187
|
if (dupes.length)
|
|
163
188
|
report.push(` probably already in the tree: ${dupes.map((d) => `${d.person.id}≈${d.same.id}`).join(", ")} (the review task lists them)`);
|
|
164
189
|
}
|
|
165
|
-
// A family tree gets its own review task; the other files of a folder share one
|
|
166
|
-
if (
|
|
190
|
+
// A family tree gets its own review task; the other files of a folder share one — files for a task: none
|
|
191
|
+
if (forTask)
|
|
192
|
+
handed.push(input.id);
|
|
193
|
+
else if (kind === "tree" || !group.folder)
|
|
167
194
|
intakeTask(tree, input, research, imported, persons);
|
|
168
195
|
else
|
|
169
196
|
plain.push(input);
|
|
@@ -172,14 +199,21 @@ register({
|
|
|
172
199
|
if (plain.length)
|
|
173
200
|
groupTask(tree, plain, research, undefined, group.folder, persons);
|
|
174
201
|
}
|
|
202
|
+
if (forTask) {
|
|
203
|
+
// the same content again: what is said of it now (the task's people, the note) added — no task of its own
|
|
204
|
+
for (const id of handed.filter((h) => !added.some((i) => i.id === h)))
|
|
205
|
+
if (id.startsWith("I"))
|
|
206
|
+
amendInput(tree, id, { persons, note }, { again: false, app: false });
|
|
207
|
+
task = handFiles(tree, forTask.id, handed, fileBy(tree, ctx.env));
|
|
208
|
+
}
|
|
175
209
|
if (typeof opts.text === "string" && opts.text.trim()) {
|
|
176
210
|
const input = create(tree, "input", { name: truncate(opts.text, 60), text: opts.text.trim(), kind: "text", state: "new", from: "user", ...(persons.length ? { persons } : {}) }, (iid) => `+${iid} input text`);
|
|
177
211
|
intakeTask(tree, input, research, undefined, persons);
|
|
178
212
|
added.push(input);
|
|
179
213
|
}
|
|
180
214
|
});
|
|
181
|
-
const text = lines(`${added.length} input(s) registered${skipped ? `, ${skipped} already known (same content)` : ""}`, added.length ? table(added.map((i) => [` ${i.id}`, i.kind, truncate(i.name, 60)])) : undefined, ...report, tree.written.some((o) => o.op === "task.add") ? `\n${tree.written.filter((o) => o.op === "task.add").length} intake task(s) created → strom task next` : undefined);
|
|
182
|
-
return { text, data: { inputs: added, skipped } };
|
|
215
|
+
const text = lines(`${added.length} input(s) registered${skipped ? `, ${skipped} already known (same content)` : ""}`, added.length ? table(added.map((i) => [` ${i.id}`, i.kind, truncate(i.name, 60)])) : undefined, ...report, tree.written.some((o) => o.op === "task.add") ? `\n${tree.written.filter((o) => o.op === "task.add").length} intake task(s) created → strom task next` : undefined, task ? `${task.id} got ${[...new Set(handed)].join(", ")} and is back in the queue — the file is read as its next step (no intake task)` : undefined);
|
|
216
|
+
return { text, data: { inputs: added, skipped, ...(task ? { task: task.id, handed: [...new Set(handed)], state: task.state } : {}) } };
|
|
183
217
|
},
|
|
184
218
|
}, {
|
|
185
219
|
path: ["input", "list"],
|
package/dist/commands/links.js
CHANGED
|
@@ -155,6 +155,12 @@ async function inTerminal(ctx, link) {
|
|
|
155
155
|
return said("ui.link.notask");
|
|
156
156
|
return end(true);
|
|
157
157
|
}
|
|
158
|
+
if (link.do === "chat" || link.do === "note" || link.do === "folder" || link.do === "sent" || link.do === "file") {
|
|
159
|
+
const { waitingDo } = await import("../cli/menu-links.js");
|
|
160
|
+
const done = await waitingDo(ctx, run, treeLang, root, link.task, link.do, agent);
|
|
161
|
+
// the conversation is the agent's (a terminal of its own, or its desktop app): nothing to wait for here
|
|
162
|
+
return link.do === "chat" && done ? { text: "", data: { done, action: link.action, tree: root } } : end(done);
|
|
163
|
+
}
|
|
158
164
|
if (link.do) {
|
|
159
165
|
const { taskDo } = await import("../cli/menu-links.js");
|
|
160
166
|
return end(await taskDo(ctx, run, treeLang, root, link.task, link.do));
|
|
@@ -336,6 +342,11 @@ register({
|
|
|
336
342
|
"strom-research://review?tree=<id>&person=P0012&scope=person|family|line — the person reviewed (strom review).\n" +
|
|
337
343
|
"strom-research://research?tree=<id>&person=P0012&direction=ancestors|descendants — a new direction (research new).\n" +
|
|
338
344
|
"strom-research://task?…&task=T0007&do=park|drop|wake — the task put aside, given up, back in the queue (the reason asked).\n" +
|
|
345
|
+
"strom-research://task?…&task=T0007&do=chat|note|folder|sent — a task that waits: a conversation about it and the tasks\n" +
|
|
346
|
+
" waiting at the same place (strom chat --task), its request's text or its folder of images opened (nothing written),\n" +
|
|
347
|
+
" its request marked sent on the user's word (strom task sent).\n" +
|
|
348
|
+
"strom-research://task?…&task=T0007&do=file — a file that came for a waiting task (dragged into the terminal, a short\n" +
|
|
349
|
+
" note): strom intake <file> --answers T0007, the task back in the queue.\n" +
|
|
339
350
|
"strom-research://conflict?tree=<id>&id=X0007&do=decide|agent — decided by the user (which claim, why) or left to the agent;\n" +
|
|
340
351
|
" &take=user|research — the side picked in the app: only confirmed, and why.\n" +
|
|
341
352
|
"strom-research://story?tree=<id>&person=P0012[&partner=P0013]&do=final|keep — the story approved (strom story approve), of a couple with partner=.\n" +
|
package/dist/commands/media.js
CHANGED
|
@@ -9,7 +9,7 @@ import { register } from "../cli/registry.js";
|
|
|
9
9
|
import { lines, moreLine, paginate, runs, shellArg, table, truncate } from "../cli/format.js";
|
|
10
10
|
import { UsageError } from "../core/errors.js";
|
|
11
11
|
import { makeNote } from "../core/actions.js";
|
|
12
|
-
import { clipText, collectFiles, coveringPart, fileSha256, findImage, imageNumbers, imageOfRef, imageRange, inboxFolders, inputPath, isWhole, mimeOf, onlyParts, otherCopies, parseImageList, regionText, sharperPart, storeShared, wholeSizeOf } from "../core/media.js";
|
|
12
|
+
import { clipText, collectFiles, coveringPart, fileSha256, findImage, imageNumbers, imageOfRef, imageRange, IMAGE_FILE_EXT, inboxFolders, inputPath, isWhole, mimeOf, onlyParts, otherCopies, parseImageList, regionText, sharperPart, storeShared, wholeSizeOf } from "../core/media.js";
|
|
13
13
|
import { create, normId, requireRecord, update } from "../core/records.js";
|
|
14
14
|
import { imageSizeOfFile } from "../image/index.js";
|
|
15
15
|
import { imageOf, pageOf } from "../core/calibration.js";
|
|
@@ -26,7 +26,8 @@ import { currentSession } from "../core/session.js";
|
|
|
26
26
|
import { originalMax, parseRegion, takeOriginal } from "../core/originals.js";
|
|
27
27
|
import { batchFull, batchPath, batchRoom, noteBatch, openBatch } from "../core/batches.js";
|
|
28
28
|
import { readEntry, readZip } from "../core/zip.js";
|
|
29
|
-
|
|
29
|
+
import { fileBy, handFiles, taskForFile, taskPeople } from "../core/taskfiles.js";
|
|
30
|
+
const IMAGE_EXT = IMAGE_FILE_EXT;
|
|
30
31
|
/**
|
|
31
32
|
* Register images of a record set: stored once by content, each with its number
|
|
32
33
|
* and provenance. Tasks that waited for images of the book go back into the queue.
|
|
@@ -95,7 +96,7 @@ export function registerImages(tree, shared, items, recordset) {
|
|
|
95
96
|
const missing = t.awaits?.recordset === recordset ? (parseImageList(t.awaits.images) ?? []).filter((n) => !have.has(n)) : [];
|
|
96
97
|
const note = `${added.length} image(s) of ${recordset} registered${t.awaits ? ` (it waited for images ${t.awaits.images}${missing.length ? `; still missing: ${runs(missing)}` : ""})` : ""}`;
|
|
97
98
|
update(tree, t.id, "task", (x) => {
|
|
98
|
-
const { awaits: _, ...rest } = x;
|
|
99
|
+
const { awaits: _, wait: _w, sent: _s, ...rest } = x;
|
|
99
100
|
return { ...rest, state: "open", notes: [...x.notes, makeNote(tree, note)] };
|
|
100
101
|
}, {
|
|
101
102
|
op: "task.wake",
|
|
@@ -972,6 +973,8 @@ register({
|
|
|
972
973
|
"within a while shares one). The same content again: only said. In an archive the tasks wait put aside.\n" +
|
|
973
974
|
"--batch: one file of a batch (its path in it with --path): an input with no task of its own — the batch's tasks come\n" +
|
|
974
975
|
"when it is closed (strom input batch done). --zip: a ZIP of a batch, unpacked file by file (a ZIP in it is only said).\n" +
|
|
976
|
+
"--task: the file came for what that waiting task waits for (X-Strom-Task): an input of its people handed to it, the\n" +
|
|
977
|
+
"task back in the queue, no intake task (strom intake --answers).\n" +
|
|
975
978
|
"Material of the family on this computer goes in with strom intake.",
|
|
976
979
|
args: [{ name: "file", description: "the received file (it is moved)", required: true }],
|
|
977
980
|
options: [
|
|
@@ -984,6 +987,7 @@ register({
|
|
|
984
987
|
{ name: "batch", type: "string", value: "<id>", description: "the batch of the app it comes in" },
|
|
985
988
|
{ name: "path", type: "string", value: "<path>", description: "its path in the batch (Babička/Dopisy/1946.jpg)" },
|
|
986
989
|
{ name: "zip", type: "boolean", description: "a ZIP of the batch: unpacked, each file taken" },
|
|
990
|
+
{ name: "task", type: "string", value: "<T…>", description: "the waiting task it came for: handed to it, the task back in the queue" },
|
|
987
991
|
],
|
|
988
992
|
examples: ["strom media original ~/Downloads/dopis.png --name dopis.png --person P0001"],
|
|
989
993
|
run(ctx, { args, opts }) {
|
|
@@ -1001,6 +1005,19 @@ register({
|
|
|
1001
1005
|
const where = batchPath(typeof opts.path === "string" ? opts.path : undefined) ?? batchPath(name) ?? name;
|
|
1002
1006
|
if (opts.zip && !batch)
|
|
1003
1007
|
throw new UsageError("a ZIP comes in a batch", { hint: "--batch <id>", code: "batch.zip-alone" });
|
|
1008
|
+
const forTask = typeof opts.task === "string" ? opts.task : undefined;
|
|
1009
|
+
if (forTask !== undefined && (batch || typeof opts.source === "string"))
|
|
1010
|
+
throw new UsageError("a file for a task is no image of a source and comes in no batch", { hint: "--task alone, with --person, --note" });
|
|
1011
|
+
if (forTask !== undefined) {
|
|
1012
|
+
const task = taskForFile(tree, forTask);
|
|
1013
|
+
persons.push(...taskPeople(tree, task));
|
|
1014
|
+
const got = tree.withTreeLock(() => {
|
|
1015
|
+
const one = takeOriginal(tree, shared, file, sha, { name, persons: [...new Set(persons)], note: typeof opts.note === "string" ? opts.note : undefined, task: true });
|
|
1016
|
+
const t = handFiles(tree, task.id, [one.input ?? one.known], fileBy(tree, ctx.env));
|
|
1017
|
+
return { ...one, task: t.id, handed: one.input ?? one.known, state: t.state };
|
|
1018
|
+
});
|
|
1019
|
+
return { text: lines(...tree.written.map((o) => o.summary)), data: got };
|
|
1020
|
+
}
|
|
1004
1021
|
const got = tree.withTreeLock(() => {
|
|
1005
1022
|
if (!batch)
|
|
1006
1023
|
return takeOriginal(tree, shared, file, sha, {
|
package/dist/commands/meta.js
CHANGED
|
@@ -11,6 +11,7 @@ import { UsageError } from "../core/errors.js";
|
|
|
11
11
|
import { helpAs } from "../cli/help.js";
|
|
12
12
|
import { lines, table } from "../cli/format.js";
|
|
13
13
|
import { guideText } from "./guide.js";
|
|
14
|
+
import { assetPath, methodPage, readAsset } from "../core/assets.js";
|
|
14
15
|
import { langName } from "../core/lang.js";
|
|
15
16
|
import { placeholders, ui } from "../cli/ui.js";
|
|
16
17
|
import { VERSION } from "../core/tree.js";
|
|
@@ -224,13 +225,26 @@ register({
|
|
|
224
225
|
path: ["guide"],
|
|
225
226
|
summary: "How to do research with strom — read this first (for agents)",
|
|
226
227
|
group: "start",
|
|
227
|
-
|
|
228
|
+
description: "With a topic, one page of the method: waiting — a conversation that begins with a task that waits for the user.",
|
|
229
|
+
args: [{ name: "topic", description: "a page of the method: waiting, core, locate, link, verify, enrich, request, intake, narrate, reading, recording" }],
|
|
230
|
+
examples: ["strom guide", "strom guide waiting"],
|
|
231
|
+
run(ctx, { args }) {
|
|
228
232
|
const lang = ctx.hasTree() ? ctx.tree().lang : ctx.settings.home() ? ctx.settings.lang().value : undefined;
|
|
229
233
|
// an archive: what it holds and who switches research on — nothing of an agent's work (Milan's decision, 2026-10-03)
|
|
230
234
|
if (ctx.hasTree() && isArchive(ctx.tree())) {
|
|
231
235
|
const said = ui(ctx.tree().lang, "ui.guide.archive");
|
|
232
236
|
return { text: said, data: { guide: said, lang, archive: true } };
|
|
233
237
|
}
|
|
238
|
+
const topic = args[0]?.trim();
|
|
239
|
+
if (topic) {
|
|
240
|
+
const page = /^[a-z]+$/u.test(topic) ? readAsset("method", `${topic}.md`) : undefined;
|
|
241
|
+
if (!page) {
|
|
242
|
+
const pages = fs.readdirSync(assetPath("method")).filter((f) => f.endsWith(".md")).map((f) => f.slice(0, -3)).sort();
|
|
243
|
+
throw new UsageError(`no page "${topic}" in the method`, { hint: `strom guide ${pages.includes("waiting") ? "waiting" : pages[0]} — pages: ${pages.join(", ")}` });
|
|
244
|
+
}
|
|
245
|
+
const text = methodPage(page, undefined).trim();
|
|
246
|
+
return { text, data: { guide: text, topic, lang } };
|
|
247
|
+
}
|
|
234
248
|
const text = guideText(lang, appUrlShown(ctx.settings).url, ctx.settings.webPerHost(ctx.hasTree() ? ctx.tree().config : undefined));
|
|
235
249
|
return { text, data: { guide: text, lang } };
|
|
236
250
|
},
|