strom-research 1.36.0 → 1.37.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.cs.md +42 -0
- package/CHANGELOG.de.md +50 -0
- package/CHANGELOG.md +45 -0
- package/CHANGELOG.pl.md +46 -0
- package/assets/lang/cs.json +40 -4
- package/assets/lang/de.json +40 -4
- package/assets/lang/pl.json +40 -4
- package/assets/strom-doc/cs/R12-where-the-agent-works.md +2 -2
- package/assets/strom-doc/de/R12-where-the-agent-works.md +2 -2
- package/assets/strom-doc/en/R12-where-the-agent-works.md +2 -2
- package/assets/strom-doc/pl/R12-where-the-agent-works.md +1 -1
- package/dist/brief/brief.js +43 -5
- package/dist/cli/menu-links.js +3 -2
- package/dist/cli/menu-waiting.js +3 -1
- package/dist/cli/ui.js +36 -4
- package/dist/commands/archives.js +11 -3
- package/dist/commands/browse.js +5 -1
- package/dist/commands/fixchecks.js +21 -1
- package/dist/commands/fixes.js +38 -6
- package/dist/commands/intake.js +10 -2
- package/dist/commands/links.js +5 -4
- package/dist/commands/media.js +14 -4
- package/dist/commands/people.js +2 -0
- package/dist/commands/session.js +54 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/sync.js +113 -54
- package/dist/commands/tasks.js +2 -2
- package/dist/core/actions.js +4 -0
- package/dist/core/appmedia.js +207 -7
- package/dist/core/changelog.js +7 -0
- package/dist/core/contact.js +220 -0
- package/dist/core/contactfix.js +260 -0
- package/dist/core/floor.js +13 -3
- package/dist/core/import.js +53 -5
- package/dist/core/inboxwait.js +93 -18
- package/dist/core/links.js +8 -2
- package/dist/core/lists.js +117 -0
- package/dist/core/live.js +273 -39
- package/dist/core/machine.js +28 -0
- package/dist/core/material.js +14 -1
- package/dist/core/mediaqueue.js +1 -1
- package/dist/core/metrics.js +32 -1
- package/dist/core/originals.js +28 -9
- package/dist/core/overview.js +1 -0
- package/dist/core/ownsave.js +43 -0
- package/dist/core/phrases.js +4 -0
- package/dist/core/queue.js +1 -1
- package/dist/core/receive.js +9 -3
- package/dist/core/runstate.js +2 -1
- package/dist/core/session.js +16 -0
- package/dist/core/shaindex.js +31 -5
- package/dist/core/shortcut.js +2 -1
- package/dist/core/stromapp.js +2 -3
- package/dist/core/sync.js +242 -27
- package/dist/core/terms.js +44 -8
- package/dist/core/text.js +11 -0
- package/dist/core/tree.js +1 -1
- package/dist/core/validate.js +21 -0
- package/dist/core/waiting.js +2 -1
- package/dist/core/web.js +49 -7
- package/dist/core/webfull.js +105 -0
- package/dist/gedcom/export.js +8 -0
- package/dist/gedcom/validate.js +2 -1
- package/package.json +4 -1
package/dist/commands/fixes.js
CHANGED
|
@@ -26,6 +26,7 @@ import { answerProven, applyProven, provenDone, provenToReview, undoProven } fro
|
|
|
26
26
|
import { applyOrigins, originsDone, undoOrigins } from "../core/originfix.js";
|
|
27
27
|
import { applyVerify, undoVerify, verifyDone } from "../core/verify.js";
|
|
28
28
|
import { applyNameStatus, nameStatusDone, undoNameStatus } from "../core/namestatusfix.js";
|
|
29
|
+
import { applyContactResidences, contactResidencesDone, undoContactResidences } from "../core/contactfix.js";
|
|
29
30
|
import { townAnswers } from "../core/streets.js";
|
|
30
31
|
import { eventKey } from "../cli/human.js";
|
|
31
32
|
import { calibrationLabel } from "../core/viewsizes.js";
|
|
@@ -321,6 +322,27 @@ const REWRITERS = {
|
|
|
321
322
|
fixed: (key, n, records) => `Fix ${key}: ${n} names a record of the research's names made probable, in ${records} records`,
|
|
322
323
|
undone: (key, n, left) => `Fix ${key}: undone, the status taken off ${n} names${left ? `, ${left} changed since left` : ""}`,
|
|
323
324
|
},
|
|
325
|
+
"contact-residences": {
|
|
326
|
+
// one residence of a contact: whose, which, what becomes of it (its e-mails to the contact, or its label off the house)
|
|
327
|
+
example: (t, item) => {
|
|
328
|
+
const r = item;
|
|
329
|
+
const result = r.how === "retract"
|
|
330
|
+
? t("ui.fixes.contact-residences.example.retract", { emails: r.emails.join(", ") })
|
|
331
|
+
: t("ui.fixes.contact-residences.example.house", { house: r.house ?? "" });
|
|
332
|
+
return t("ui.fixes.contact-residences.example", { owner: r.owner, event: r.event, result });
|
|
333
|
+
},
|
|
334
|
+
left: (t, item) => {
|
|
335
|
+
const r = item;
|
|
336
|
+
return t("ui.fixes.contact-residences.kept", { owner: r.owner, event: r.event, why: t(`ui.fixes.contact-residences.kept.${r.why}`) });
|
|
337
|
+
},
|
|
338
|
+
apply: (tree, items, config) => applyContactResidences(tree, items, VERSION, config),
|
|
339
|
+
done: (tree) => contactResidencesDone(tree).length,
|
|
340
|
+
undo: (tree, config) => undoContactResidences(tree, config),
|
|
341
|
+
ask: "Move the e-mails out of the residences that are contacts into the persons' contacts (the residences withdrawn)?",
|
|
342
|
+
askUndo: "Put the residences of contacts back as they were and take off the e-mails the fix added?",
|
|
343
|
+
fixed: (key, n, records) => `Fix ${key}: ${n} residences of contacts set right, their e-mails in the persons' contacts, in ${records} records`,
|
|
344
|
+
undone: (key, n, left) => `Fix ${key}: undone, ${n} residences of contacts put back as they were${left ? `, ${left} changed since left` : ""}`,
|
|
345
|
+
},
|
|
324
346
|
};
|
|
325
347
|
/** A kind of fact in the person's words: "narození"; a kind with no word as it is written. */
|
|
326
348
|
const kindWord = (t, kind) => {
|
|
@@ -806,7 +828,7 @@ register({
|
|
|
806
828
|
"beside the earlier one, a difference becomes a task. The person decides: set it right (strom fixes run), leave it as\n" +
|
|
807
829
|
"it is (strom fixes decline) or later (nothing kept). The decision is kept with the research (strom.json \"fixes\")\n" +
|
|
808
830
|
"and holds on every computer. strom doctor and the menu say when one waits. In an archive only participant-names,\n" +
|
|
809
|
-
"app-shapes and
|
|
831
|
+
"app-shapes, street-places and contact-residences.\n" +
|
|
810
832
|
"The checks: blind-reduced — a reading of a part of an image (strom read --crop) read from the whole image, reduced,\n" +
|
|
811
833
|
"where a sharper copy of the part was at hand (strom before 1.19.0); where this computer has no record of the\n" +
|
|
812
834
|
"reading's views, the place is estimated from the sources' entries on the image, and said so.\n" +
|
|
@@ -883,8 +905,17 @@ register({
|
|
|
883
905
|
"confirmed against the scan or wrote, never on a citation an import brought (the family tree's source, the import\n" +
|
|
884
906
|
"that gave the name, a source of the Strom app the research never read). Set right in an archive too, never shown there.\n" +
|
|
885
907
|
"One operation, one commit; strom fixes undo name-status takes the status off each name still as the fix left it.\n" +
|
|
908
|
+
"contact-residences — an e-mail of a family tree taken in that became a residence before strom 1.37.0 (since then\n" +
|
|
909
|
+
"the person's contact, strom person show): a residence of nothing but a note of e-mail lines (\"E-mail: x\", the\n" +
|
|
910
|
+
"Strom app's older form), an empty one an import of another program's GEDCOM made of 1 RESI / 2 EMAIL (the e-mail\n" +
|
|
911
|
+
"read again from the file kept in inputs/, the person by the xref the import left; none found there: left as it is,\n" +
|
|
912
|
+
"not offered), one whose house is the label of an address (\"Email\": taken off always). Set right by rules on the\n" +
|
|
913
|
+
"person's word alone (free, also in an archive): the e-mails join the person's contact (each once), the residence\n" +
|
|
914
|
+
"withdrawn with the reason — never deleted; one citing a record, with people at it or a note of its own beside the\n" +
|
|
915
|
+
"e-mail is left and listed with why (--json: left). One operation, one commit; strom fixes undo contact-residences\n" +
|
|
916
|
+
"puts the residences back and takes off only the e-mails the fix added.\n" +
|
|
886
917
|
SET_RIGHT_HELP,
|
|
887
|
-
examples: ["strom fixes", "strom fixes show blind-reduced", "strom fixes show new-model", "strom fixes show participant-names", "strom fixes show app-shapes", "strom fixes show street-places", "strom fixes show edit-decisions", "strom fixes show woken-waits", "strom fixes show readers", "strom fixes show proven-originals", "strom fixes show origins", "strom fixes show verify-originals", "strom fixes show name-status", "strom fixes --json"],
|
|
918
|
+
examples: ["strom fixes", "strom fixes show blind-reduced", "strom fixes show new-model", "strom fixes show participant-names", "strom fixes show app-shapes", "strom fixes show street-places", "strom fixes show edit-decisions", "strom fixes show woken-waits", "strom fixes show readers", "strom fixes show proven-originals", "strom fixes show origins", "strom fixes show verify-originals", "strom fixes show name-status", "strom fixes show contact-residences", "strom fixes --json"],
|
|
888
919
|
run: (ctx) => {
|
|
889
920
|
const tree = ctx.tree();
|
|
890
921
|
const t = (key, values = {}) => ui(tree.lang, key, values);
|
|
@@ -932,7 +963,7 @@ register({
|
|
|
932
963
|
"Who reads: --agent and --model; else, where more agents can read here, the person chooses — each said with whether\n" +
|
|
933
964
|
"it read these before, another one recommended where the one now did. After the first few, the rest is estimated\n" +
|
|
934
965
|
"again by the real time they took.\n" +
|
|
935
|
-
"participant-names, app-shapes
|
|
966
|
+
"participant-names, app-shapes, street-places and contact-residences read nothing: set right as shown (strom fixes show <check>), all or none, in one\n" +
|
|
936
967
|
"operation and one commit, free, also in an archive; strom fixes undo <check> puts it back. So do edit-decisions and\n" +
|
|
937
968
|
"woken-waits and readers, never in an archive (an agent's work); readers, proven-originals, origins, verify-originals and name-status are set right by themselves once,\n" +
|
|
938
969
|
"run again only after strom fixes undo or reopen.\n" +
|
|
@@ -1042,7 +1073,7 @@ register({
|
|
|
1042
1073
|
},
|
|
1043
1074
|
}, {
|
|
1044
1075
|
path: ["fixes", "undo"],
|
|
1045
|
-
summary: "Put back what a check that rewrites set right (participant-names, app-shapes, street-places, edit-decisions, woken-waits, readers, proven-originals, origins, verify-originals, name-status): as it was before the fix (the person's own)",
|
|
1076
|
+
summary: "Put back what a check that rewrites set right (participant-names, app-shapes, street-places, edit-decisions, woken-waits, readers, proven-originals, origins, verify-originals, name-status, contact-residences): as it was before the fix (the person's own)",
|
|
1046
1077
|
group: "history",
|
|
1047
1078
|
tree: true,
|
|
1048
1079
|
person: "Putting a fix back is the person's own decision, at their own terminal: never done by an agent",
|
|
@@ -1051,11 +1082,12 @@ register({
|
|
|
1051
1082
|
"(street-places); each disagreement closed again as the agent decided it (edit-decisions); each task back in the\n" +
|
|
1052
1083
|
"queue as the images woke it (woken-waits); each source read by the user again (readers); each fact proven again\n" +
|
|
1053
1084
|
"(proven-originals); each mark of where a value came from taken off (origins); each task of verification nobody started\n" +
|
|
1054
|
-
"dropped (verify-originals); each name's status taken off (name-status)
|
|
1085
|
+
"dropped (verify-originals); each name's status taken off (name-status); each residence of a contact back and the\n" +
|
|
1086
|
+
"e-mails the fix added taken off the contact (contact-residences) — where it is still as the fix left it; one\n" +
|
|
1055
1087
|
"changed since is left as it is and counted. One step of the history (one operation, one commit); the fix is then left as it is\n" +
|
|
1056
1088
|
"(strom fixes reopen asks again). Also in an archive (edit-decisions, woken-waits, readers, origins, verify-originals and name-status not).",
|
|
1057
1089
|
args: [{ name: "check", description: "the check, e.g. participant-names", required: true }],
|
|
1058
|
-
examples: ["strom fixes undo participant-names", "strom fixes undo app-shapes", "strom fixes undo street-places", "strom fixes undo edit-decisions", "strom fixes undo readers", "strom fixes undo proven-originals", "strom fixes undo origins", "strom fixes undo verify-originals", "strom fixes undo name-status"],
|
|
1090
|
+
examples: ["strom fixes undo participant-names", "strom fixes undo app-shapes", "strom fixes undo street-places", "strom fixes undo edit-decisions", "strom fixes undo readers", "strom fixes undo proven-originals", "strom fixes undo origins", "strom fixes undo verify-originals", "strom fixes undo name-status", "strom fixes undo contact-residences"],
|
|
1059
1091
|
run: (ctx, { args }) => {
|
|
1060
1092
|
const tree = ctx.tree();
|
|
1061
1093
|
const t = (key, values = {}) => ui(tree.lang, key, values);
|
package/dist/commands/intake.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// a tree exported from the Strom app, a text the user types. Inputs are the
|
|
5
5
|
// unchanged BASE of a research; the agent builds the working tree from them
|
|
6
6
|
// through tasks, and the tree it builds is exported as GEDCOM.
|
|
7
|
+
import { takeList } from "../core/lists.js";
|
|
7
8
|
import fs from "node:fs";
|
|
8
9
|
import path from "node:path";
|
|
9
10
|
import { register } from "../cli/registry.js";
|
|
@@ -350,6 +351,8 @@ register({
|
|
|
350
351
|
...(nt.objects ? [ui(tree.lang, "ui.intake.notTaken.objects", { n: nt.objects })] : []),
|
|
351
352
|
...(nt.links ? [ui(tree.lang, "ui.intake.notTaken.links", { n: nt.links })] : []),
|
|
352
353
|
...Object.entries(nt.tags).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, 8).map(([t, n]) => `${t} ×${n}`),
|
|
354
|
+
// what of a contact the research does not keep (spec 134 U11): a phone, a fax, a web page
|
|
355
|
+
...Object.entries(nt.contact ?? {}).sort((a, b) => a[0].localeCompare(b[0])).map(([t, n]) => `${t} ×${n}`),
|
|
353
356
|
]
|
|
354
357
|
: [];
|
|
355
358
|
if (ntList.length)
|
|
@@ -450,7 +453,7 @@ register({
|
|
|
450
453
|
// the file gone (the shared folder not brought along, deleted by hand): said, never shown as if it were there
|
|
451
454
|
const missing = !!abs && !fs.existsSync(abs);
|
|
452
455
|
const tasks = tree.list("task").filter((t) => t.where.includes(i.id));
|
|
453
|
-
const text = lines(`${i.id} ${i.name} [${i.kind} · ${deleted ? `deleted for good ${deleted.slice(0, 10)}` : i.state}]`, deleted ? "file none: deleted for good by the person (the same content brought again is new material)" : undefined, abs ? `file ${abs}${missing ? ` — missing on this computer: bring back the ${i.file?.startsWith("media:") ? "shared folder from a backup of the whole Strom folder (its subfolder shared)" : "research's folder from a backup"}` : ""}` : undefined, i.from ? `from ${i.from}` : undefined, i.batch ? `batch ${i.batch}${i.path ? ` · ${i.path}` : ""}` : undefined, i.persons?.length ? `of ${i.persons.join(", ")}` : undefined, i.sorted ? `sorted ${i.sorted.as}${i.sorted.source ? ` → ${i.sorted.source}` : ""}${i.sorted.reason ? ` (${i.sorted.reason})` : ""}` : undefined, i.mime ? `type ${i.mime}${i.size !== undefined ? ` · ${Math.round(i.size / 1024)} kB` : ""}` : undefined, i.imported ? `import ${i.imported.persons} persons, ${i.imported.families} families as leads, cited as ${i.source}` : undefined, i.read?.length ? `read ${readingsLine(tree, i)}` : undefined, i.text ? `\n${i.text}` : undefined, !i.text && i.kind === "text" && abs && fs.existsSync(abs) && (i.size ?? 0) < 20_000 && /\.(txt|md|csv)$/i.test(abs) ? `\n${fs.readFileSync(abs, "utf8").trim()}` : undefined, tasks.length ? `\ntasks\n${table(tasks.map((t) => [` ${t.id}`, t.state, truncate(t.what, 60)]))}` : undefined, ...i.notes.map((n) => `note ${n.text}`), i.kind === "document" && abs && !missing && !readingsOf(tree, i).some((r) => r.state === "done")
|
|
456
|
+
const text = lines(`${i.id} ${i.name} [${i.kind} · ${deleted ? `deleted for good ${deleted.slice(0, 10)}` : i.state}]`, deleted ? "file none: deleted for good by the person (the same content brought again is new material)" : undefined, abs ? `file ${abs}${missing ? ` — missing on this computer: bring back the ${i.file?.startsWith("media:") ? "shared folder from a backup of the whole Strom folder (its subfolder shared)" : "research's folder from a backup"}` : ""}` : undefined, i.from ? `from ${i.from}` : undefined, i.batch ? `batch ${i.batch}${i.path ? ` · ${i.path}` : ""}` : undefined, i.persons?.length ? `of ${i.persons.join(", ")}` : undefined, i.list ? `list "${i.list.name}" · ${i.list.count} ${i.list.count === 1 ? "person" : "people"}${i.list.missing ? ` (${i.list.missing} more not in the research)` : ""}${i.list.rule ? ` · rule: ${i.list.rule}` : ""} · ${path.join(tree.root, ...i.list.file.split("/"))}` : undefined, i.sorted ? `sorted ${i.sorted.as}${i.sorted.source ? ` → ${i.sorted.source}` : ""}${i.sorted.reason ? ` (${i.sorted.reason})` : ""}` : undefined, i.mime ? `type ${i.mime}${i.size !== undefined ? ` · ${Math.round(i.size / 1024)} kB` : ""}` : undefined, i.imported ? `import ${i.imported.persons} persons, ${i.imported.families} families as leads, cited as ${i.source}` : undefined, i.read?.length ? `read ${readingsLine(tree, i)}` : undefined, i.text ? `\n${i.text}` : undefined, !i.text && i.kind === "text" && abs && fs.existsSync(abs) && (i.size ?? 0) < 20_000 && /\.(txt|md|csv)$/i.test(abs) ? `\n${fs.readFileSync(abs, "utf8").trim()}` : undefined, tasks.length ? `\ntasks\n${table(tasks.map((t) => [` ${t.id}`, t.state, truncate(t.what, 60)]))}` : undefined, ...i.notes.map((n) => `note ${n.text}`), i.kind === "document" && abs && !missing && !readingsOf(tree, i).some((r) => r.state === "done")
|
|
454
457
|
? `\nread the file (a big image: strom media view ${i.id} --grid, then --crop), then record what it says: strom source add … --input ${i.id}`
|
|
455
458
|
: undefined);
|
|
456
459
|
return { text, data: { input: i, path: abs, ...(deleted ? { deleted } : {}), ...(missing ? { missing: true } : {}), tasks: tasks.map((t) => t.id), ...(i.read?.length ? { readings: readingsOf(tree, i) } : {}) } };
|
|
@@ -698,6 +701,7 @@ register({
|
|
|
698
701
|
{ name: "person", type: "string", multiple: true, value: "<P…>", description: "a person it is of (repeatable)" },
|
|
699
702
|
{ name: "family", type: "string", multiple: true, value: "<F…>", description: "a couple it is of (repeatable): material of both partners" },
|
|
700
703
|
{ name: "note", type: "string", value: "<text>", description: "what the user said of it" },
|
|
704
|
+
{ name: "list", type: "string", value: "<id>", description: "the list of people the app sent it to (the bridge keeps it): kept on the input as sent now, up to 50 of its people its people too" },
|
|
701
705
|
],
|
|
702
706
|
examples: ["strom input amend I0002 --person P0001 --note \"<what the user said of it>\""],
|
|
703
707
|
run(ctx, { args, opts }) {
|
|
@@ -705,7 +709,11 @@ register({
|
|
|
705
709
|
const id = normId(args[0], "input");
|
|
706
710
|
const persons = (Array.isArray(opts.person) ? opts.person : opts.person ? [opts.person] : []).flatMap((p) => String(p).split(",")).map((p) => p.trim().toUpperCase()).filter(Boolean);
|
|
707
711
|
const families = (Array.isArray(opts.family) ? opts.family : opts.family ? [opts.family] : []).flatMap((f) => String(f).split(",")).map((f) => f.trim().toUpperCase()).filter(Boolean);
|
|
708
|
-
const got = tree.withTreeLock(() =>
|
|
712
|
+
const got = tree.withTreeLock(() => {
|
|
713
|
+
// the list it was sent to now: its people up to 50 its people too, after those named
|
|
714
|
+
const sent = typeof opts.list === "string" ? takeList(tree, opts.list) : undefined;
|
|
715
|
+
return amendInput(tree, id, { persons: [...new Set([...persons, ...(sent?.persons ?? [])])], note: typeof opts.note === "string" ? opts.note : undefined, ...(families.length ? { families } : {}), ...(sent ? { list: sent.list } : {}) }, { auto: ctx.settings.intakeAuto(tree.config) });
|
|
716
|
+
});
|
|
709
717
|
return { text: tree.written.length ? lines(...tree.written.map((o) => o.summary)) : `${id}: nothing new`, data: got };
|
|
710
718
|
},
|
|
711
719
|
}, {
|
package/dist/commands/links.js
CHANGED
|
@@ -502,7 +502,7 @@ async function openLink(ctx, link, handed) {
|
|
|
502
502
|
if (ctx.io.tty) {
|
|
503
503
|
const { newFromApp } = await import("../cli/menu-links.js");
|
|
504
504
|
const { openAppAt } = await import("./sync.js");
|
|
505
|
-
const done = await newFromApp(ctx, runnerOf(ctx), link.app, (url) => openAppAt(ctx, url, { holdsTree: true }), () => bringForward(ctx.env), { ...(link.browser ? { browser: link.browser } : {}), ...(link.file ? { file: link.file } : {}) });
|
|
505
|
+
const done = await newFromApp(ctx, runnerOf(ctx), link.app, (url) => openAppAt(ctx, url, { holdsTree: true }), () => bringForward(ctx.env), { ...(link.browser ? { browser: link.browser } : {}), ...(link.file ? { file: link.file } : {}), ...(link.name ? { name: link.name } : {}) });
|
|
506
506
|
if (!done)
|
|
507
507
|
await pause(ctx, ctx.uiLang(), "ui.enter.close");
|
|
508
508
|
return { text: "", data: { done, action: "new" } };
|
|
@@ -670,13 +670,14 @@ register({
|
|
|
670
670
|
" its hash (the bridge's /log head, or its first 8), else the earlier changes to pick from — what returns shown, the\n" +
|
|
671
671
|
" return only on the person's word in the terminal.\n" +
|
|
672
672
|
"strom-research://update|sessions|setup?tree=<id> — strom update, the agent's sessions and their cost, strom setup.\n" +
|
|
673
|
-
"strom-research://new?app=<the app's mark> — a tree of the app becomes a new research: named, made, the app hands the\n" +
|
|
674
|
-
"tree to its bridge (?adopt=, GET/POST /adopt), taken in as leads, sent back to the app.
|
|
673
|
+
"strom-research://new?app=<the app's mark>[&name=<text>] — a tree of the app becomes a new research: named, made, the app hands the\n" +
|
|
674
|
+
"tree to its bridge (?adopt=, GET/POST /adopt), taken in as leads, sent back to the app. name= (one line, at most 120\n" +
|
|
675
|
+
"characters) is only the name suggested in the terminal, the person keeps it or writes another. Family trees here already:\n" +
|
|
675
676
|
"opening one of them in the app (strom app) is offered first; with no terminal the result lists them (trees).\n" +
|
|
676
677
|
"What writes tasks or starts the agent is said and asked in the terminal first; with run.confirm no (the person's,\n" +
|
|
677
678
|
"this computer's) what only starts the agent on the subscription or AI credit starts at once, one line says so — a\n" +
|
|
678
679
|
"price in money, a consent, a deletion, a request sent, the gate and an agent's own command still ask. Any page can open such a link:\n" +
|
|
679
|
-
"each part is checked (only IDs and fixed values, never text), an unknown research, person, task or excerpt is\n" +
|
|
680
|
+
"each part is checked (only IDs and fixed values, never text but new's suggested name), an unknown research, person, task or excerpt is\n" +
|
|
680
681
|
"only said. No link: the menu.\n" +
|
|
681
682
|
"&handoff=<uuid> (any link of a research): the app's id of it — written when the link was taken (the terminal it\n" +
|
|
682
683
|
"opens came up, or what needs none was done) and said by the research's bridge in GET /status (handoffs) for a\n" +
|
package/dist/commands/media.js
CHANGED
|
@@ -46,6 +46,7 @@ import { scanLikeness } from "../core/samescan.js";
|
|
|
46
46
|
import { moveToTrash } from "../core/trash.js";
|
|
47
47
|
import { recordsBySha } from "../core/shaindex.js";
|
|
48
48
|
import { jobsOf, takeBatchFile, takeQueued } from "../core/mediaqueue.js";
|
|
49
|
+
import { saveNeverOpened } from "../core/ownsave.js";
|
|
49
50
|
const IMAGE_EXT = IMAGE_FILE_EXT;
|
|
50
51
|
/**
|
|
51
52
|
* Register images of a record set: stored once by content, each with its number
|
|
@@ -768,6 +769,10 @@ export function heldSaves(tree, shared, downloads, now = Date.now()) {
|
|
|
768
769
|
const inFolder = fs.existsSync(dir) && folderFiles(dir).length > 0;
|
|
769
770
|
if (dl.file || dl.unfinished || inFolder || now - r.at < HELD_AFTER_MS)
|
|
770
771
|
continue;
|
|
772
|
+
// its page refused by the hook and nothing of its site let through since: the script never ran — nothing held back
|
|
773
|
+
// by the browser, nothing for the person to allow (core/ownsave.ts)
|
|
774
|
+
if (saveNeverOpened(tree, r))
|
|
775
|
+
continue;
|
|
771
776
|
held.push(r);
|
|
772
777
|
}
|
|
773
778
|
const fresh = held.filter((r) => !r.held);
|
|
@@ -879,7 +884,7 @@ export function takenLines(taken) {
|
|
|
879
884
|
`${t.folder}/: ${t.added.length ? `images ${runs(t.added)} of ${t.recordset} registered${t.byOrder ? " (numbered by their order: the names gave none of the numbers asked for)" : ""}` : t.aside?.length ? `nothing taken: ${counted(t.aside.length, "file")} set aside` : "nothing new (the same scans are registered)"}`,
|
|
880
885
|
t.woken.length ? ` — back in the queue: ${t.woken.join(" ")}` : t.missing.length ? ` — ${who} still waits${t.missing.length ? ` for images ${runs(t.missing)}` : ""}` : "",
|
|
881
886
|
t.book && t.added.length ? ` — the book's own folder: its tasks read them from disk (${who})` : "",
|
|
882
|
-
t.left ? ` — ${counted(t.left, "file")} left lying: no image number in the name (name each by the number its viewer counts, 40.jpg)` : "",
|
|
887
|
+
t.left ? ` — ${counted(t.left, "file")} left lying: no image number in the name (name each by the number its viewer counts, 40.jpg, or with it in the name, __0040.jpg)` : "",
|
|
883
888
|
].join("")].concat((t.copies ?? []).map((c) => ` ${c}`), (t.aside ?? []).map((c) => ` ⚠ ${c}`));
|
|
884
889
|
});
|
|
885
890
|
}
|
|
@@ -1822,7 +1827,7 @@ register({
|
|
|
1822
1827
|
if (awaited && recordset && !opts.first && opts.image === undefined && !wantsPart) {
|
|
1823
1828
|
const numbered = numberFiles(items.map((it) => it.file), parseImageList(awaited.images), registeredImages(tree, recordset), recordset, bookTimes(tree, recordset));
|
|
1824
1829
|
if ("problem" in numbered)
|
|
1825
|
-
throw new UsageError(numbered.problem, { hint: "rename the files by the image number the viewer shows (9.jpg), or --image <n> for one file", code: numbered.code, params: numbered.params });
|
|
1830
|
+
throw new UsageError(numbered.problem, { hint: "rename the files by the image number the viewer shows (9.jpg; the number in the name is enough, __0009.jpg), or --image <n> for one file", code: numbered.code, params: numbered.params });
|
|
1826
1831
|
if (numbered.by === "order") {
|
|
1827
1832
|
byOrder = true;
|
|
1828
1833
|
// in the order of the folder (as a person sorts it), not as collected
|
|
@@ -1836,7 +1841,7 @@ register({
|
|
|
1836
1841
|
const bare = items.filter((it) => it.image === undefined);
|
|
1837
1842
|
if (bare.length)
|
|
1838
1843
|
throw new UsageError(`${counted(bare.length, "file")} without an image number in the name: ${bare.slice(0, 5).map((it) => path.basename(it.file)).join(", ")}${bare.length > 5 ? " …" : ""}`, {
|
|
1839
|
-
hint: "name each by its number as the portal's viewer counts it (9.jpg), or --image <n> for one file, --first <n> for files in order",
|
|
1844
|
+
hint: "name each by its number as the portal's viewer counts it (9.jpg; the number in the name is enough, __0009.jpg), or --image <n> for one file, --first <n> for files in order",
|
|
1840
1845
|
});
|
|
1841
1846
|
}
|
|
1842
1847
|
// what the person put into the shared inbox: the tasks it completes go ahead in the queue, once (core/queue.ts goesAhead)
|
|
@@ -2054,7 +2059,7 @@ register({
|
|
|
2054
2059
|
return {
|
|
2055
2060
|
text: lines(`${m.id} ${m.part ? `part ${regionText(partShown(sharedDir(ctx), all, m))} of ` : ""}${b ? `image ${m.image ?? "?"} of ${b.id} ${b.title}` : "image"}${pageLabel(tree, m) ? ` · page ${pageLabel(tree, m)}` : ""}`, `${m.width ? `${m.width}×${m.height} px · ` : ""}${Math.round(m.size / 1024)} kB · ${m.mime}${m.from ? ` · from ${m.from}` : ""}${m.url ? ` · ${m.url}` : ""}`, m.retracted ? `RETRACTED ${localDayOf(m.retracted.at)}: ${m.retracted.reason} — no view, part or excerpt uses it` : undefined, parts.length ? `parts of it, sharper (a view of the image uses them by itself): ${parts.map((p) => `${p.id} ${regionText(partShown(sharedDir(ctx), all, p))}${p.width ? ` ${p.width}×${p.height}` : ""}`).join(" · ")}` : undefined, copies.length
|
|
2056
2061
|
? `other copies of the image: ${copies.map((c) => `${c.id}${c.width ? ` ${c.width}×${c.height}` : ""}`).join(" · ")} — the image is the sharpest (${image.id}); a view of any copy uses it`
|
|
2057
|
-
: undefined, sources.length ? `sources on it: ${sources.map((s) => `${s.id} ${s.title}`).join(" · ")}` : "no source cites it yet", `view: strom media view ${m.id} [--half left|right] [--crop x,y,w,h] [--grid]`),
|
|
2062
|
+
: undefined, sources.length ? `sources on it: ${sources.map((s) => `${s.id} ${s.title}`).join(" · ")}` : "no source cites it yet", m.list ? `sent to the list "${m.list.name}" · ${m.list.count} ${m.list.count === 1 ? "person" : "people"}${m.list.missing ? ` (${m.list.missing} more not in the research)` : ""}${m.list.rule ? ` · rule: ${m.list.rule}` : ""} · ${path.join(tree.root, ...m.list.file.split("/"))}` : undefined, `view: strom media view ${m.id} [--half left|right] [--crop x,y,w,h] [--grid]`),
|
|
2058
2063
|
data: { media: m, parts: parts.map((p) => p.id), copies: copies.map((c) => c.id), sources: sources.map((s) => s.id), page: pageLabel(tree, m) || undefined },
|
|
2059
2064
|
};
|
|
2060
2065
|
},
|
|
@@ -2383,6 +2388,7 @@ register({
|
|
|
2383
2388
|
{ name: "replace", type: "boolean", description: "with --task: another scan at that number replaces the one there (withdrawn and kept, never deleted)" },
|
|
2384
2389
|
{ name: "phone", type: "boolean", description: "sent from a paired phone (its server runs it): material of a phone's batch" },
|
|
2385
2390
|
{ name: "read", type: "boolean", description: "sent to be read at once (strom document read): an input with no intake task" },
|
|
2391
|
+
{ name: "list", type: "string", value: "<id>", description: "the list of people the app sent it to (the bridge keeps it, PUT lists/<id>): kept on the input, up to 50 of its people its people too" },
|
|
2386
2392
|
],
|
|
2387
2393
|
examples: ["strom media original ~/Downloads/dopis.png --name dopis.png --person P0001"],
|
|
2388
2394
|
run(ctx, { args, opts }) {
|
|
@@ -2406,6 +2412,9 @@ register({
|
|
|
2406
2412
|
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" });
|
|
2407
2413
|
if (opts.read && (batch || forTask !== undefined || typeof opts.source === "string"))
|
|
2408
2414
|
throw new UsageError("a file to read is no image of a source, comes in no batch and for no task", { hint: "--read alone, with --person, --note" });
|
|
2415
|
+
const list = typeof opts.list === "string" ? opts.list : undefined;
|
|
2416
|
+
if (list !== undefined && (batch || forTask !== undefined || opts.read))
|
|
2417
|
+
throw new UsageError("a file sent to a list is material of people or a scan of a source: in no batch, for no task, not to read at once", { hint: "--list with --person, --source, --note", code: "media.bad-header", params: { header: "X-Strom-List-Ref" } });
|
|
2409
2418
|
const image = opts.image !== undefined ? Number(opts.image) : undefined;
|
|
2410
2419
|
if (image !== undefined && (!Number.isInteger(image) || image < 1 || image > 999_999))
|
|
2411
2420
|
throw new UsageError("--image is the image's number in the book (1 or more)", { code: "media.bad-header", params: { header: "X-Strom-Image" } });
|
|
@@ -2446,6 +2455,7 @@ register({
|
|
|
2446
2455
|
region: parseRegion(typeof opts.region === "string" ? opts.region : undefined),
|
|
2447
2456
|
note: typeof opts.note === "string" ? opts.note : undefined,
|
|
2448
2457
|
...(opts.read ? { read: true } : {}),
|
|
2458
|
+
...(list ? { list } : {}),
|
|
2449
2459
|
// a task for an agent only where the person turned intake.auto on (spec 130 K1.3)
|
|
2450
2460
|
auto: ctx.settings.intakeAuto(tree.config),
|
|
2451
2461
|
});
|
package/dist/commands/people.js
CHANGED
|
@@ -376,6 +376,8 @@ register({
|
|
|
376
376
|
w.say("ui.show.facts", "facts"),
|
|
377
377
|
p.events.length ? table(p.events.map((e) => [` ${eventLine(e, w, sourcesOf(tree))}`])) : ` ${w.say("ui.show.none", "(none)")}`,
|
|
378
378
|
...p.events.filter((e) => e.note).map((e) => ` ${e.id} ${w.say("ui.show.note", "note")}: ${truncate(e.note, 160)}`),
|
|
379
|
+
// the person's contact (spec 134 U11): apart from the facts, never a residence
|
|
380
|
+
...(p.contact?.emails?.length ? ["", `${w.say("ui.show.contact", "contact")}: ${p.contact.emails.join(", ")}`] : []),
|
|
379
381
|
"",
|
|
380
382
|
w.say("ui.show.family", "family"),
|
|
381
383
|
];
|
package/dist/commands/session.js
CHANGED
|
@@ -40,6 +40,7 @@ import { create, csvOpt, normId, requireRecord, update } from "../core/records.j
|
|
|
40
40
|
import { finishTask, nextAwake, offTreeLine, taskQueue, waitingLines, wakesBy } from "./tasks.js";
|
|
41
41
|
import { takenLines, takeWaiting } from "./media.js";
|
|
42
42
|
import { clockUp } from "../core/net.js";
|
|
43
|
+
import { fullWebSites, webFullInputs, webFullOfTask } from "../core/webfull.js";
|
|
43
44
|
import { resolveResearch } from "./research.js";
|
|
44
45
|
import { writeGedcoms } from "./output.js";
|
|
45
46
|
import { auditLine, auditOf, audited, WAIT_CHECKLIST } from "../core/taskaudit.js";
|
|
@@ -960,6 +961,11 @@ register(updatedDuringRun({
|
|
|
960
961
|
"A task whose archive is not answering now (left alone for a while: it went silent, or asked to slow down) waits\n" +
|
|
961
962
|
"out of the queue until then; when only such tasks are left, --loop and --until wait for that time (within\n" +
|
|
962
963
|
"--until), any other run ends saying when.\n" +
|
|
964
|
+
"A task whose work goes to a site through the agent's web tools (its browser, its web fetch: no connector here the\n" +
|
|
965
|
+
"direct way, or an image of it saved through the browser waits) while that site's pages for this computer are used\n" +
|
|
966
|
+
"up (web.perHost within run.minutes, every session here) is left for now and other work taken; when only such tasks\n" +
|
|
967
|
+
"are left, --loop and --until wait until a third of web.perHost is free again (no agent, nothing sent), any other\n" +
|
|
968
|
+
"run ends saying when (stop reason: web).\n" +
|
|
963
969
|
"Tasks another session holds (its agent alive: strom started it, or a strom command of it within task.hold) are\n" +
|
|
964
970
|
"left out; a session whose holder gave no sign of life for task.hold (default 30 min, 5 min–24 h) is taken over\n" +
|
|
965
971
|
"at the start of each session — closed as interrupted, what it wrote kept, its task back in the queue. A task on\n" +
|
|
@@ -1096,6 +1102,8 @@ register(updatedDuringRun({
|
|
|
1096
1102
|
let retaken = false;
|
|
1097
1103
|
// the restricted archives the run waits for (spec 127 K2.3): in their queues while it waits, left when it ends
|
|
1098
1104
|
const queued = new Set();
|
|
1105
|
+
// the tasks the run left for now because their site's pages are used up here: said once each
|
|
1106
|
+
const webSaid = new Set();
|
|
1099
1107
|
const runShared = ctx.settings.shared()?.value;
|
|
1100
1108
|
const leaveQueues = () => {
|
|
1101
1109
|
for (const site of queued)
|
|
@@ -1279,12 +1287,28 @@ register(updatedDuringRun({
|
|
|
1279
1287
|
archiveOut.push(archiveSkip(t.id, site, held.get(site), root));
|
|
1280
1288
|
return !!site;
|
|
1281
1289
|
};
|
|
1290
|
+
// the sites whose pages for the agents' web tools are used up on this computer (core/webfull.ts): the tasks whose
|
|
1291
|
+
// work goes there left for now — a session on one would be refused its first page and wait for nothing
|
|
1292
|
+
const webFull = fullWebSites(tree, runShared);
|
|
1293
|
+
const webIn = webFull.size ? webFullInputs(tree, runShared) : undefined;
|
|
1294
|
+
const webOut = new Map();
|
|
1295
|
+
const onWebFull = (t) => {
|
|
1296
|
+
const f = webIn && webFullOfTask(tree, t, webFull, webIn);
|
|
1297
|
+
if (!f)
|
|
1298
|
+
return false;
|
|
1299
|
+
webOut.set(t.id, f);
|
|
1300
|
+
if (!webSaid.has(t.id)) {
|
|
1301
|
+
webSaid.add(t.id);
|
|
1302
|
+
out(ui(lang, "ui.run.skip.web", { task: t.id, site: f.site, at: clockUp(f.until) }));
|
|
1303
|
+
}
|
|
1304
|
+
return true;
|
|
1305
|
+
};
|
|
1282
1306
|
// the lines other runs hold (spec 126): a run of a line takes its line's work and shared work no run's line is;
|
|
1283
1307
|
// a run of the whole queue leaves every line with a run of its own
|
|
1284
1308
|
const lineOk = lineRunFilter(tree, line?.id, worker);
|
|
1285
1309
|
const freeOf = (busy) => placesOnly
|
|
1286
1310
|
? tree.list("task").find((t) => t.origin === PLACES_IDENTIFY_ORIGIN && (t.state === "open" || t.state === "doing") && !busy.has(t.id))
|
|
1287
|
-
: taskQueue(tree, { ...(research ? { research: research.id } : {}), strategy: ctx.settings.strategy(tree.config), ...(historyOnly ? { history: "only" } : RUN_TURNS) }).find((t) => !busy.has(t.id) && lineOk(t) && !onHeld(t));
|
|
1311
|
+
: taskQueue(tree, { ...(research ? { research: research.id } : {}), strategy: ctx.settings.strategy(tree.config), ...(historyOnly ? { history: "only" } : RUN_TURNS) }).find((t) => !busy.has(t.id) && lineOk(t) && !onHeld(t) && !onWebFull(t));
|
|
1288
1312
|
const free = () => freeOf(others);
|
|
1289
1313
|
let task;
|
|
1290
1314
|
if (placesOnly) {
|
|
@@ -1320,6 +1344,35 @@ register(updatedDuringRun({
|
|
|
1320
1344
|
// spent on being told so, nothing sent meanwhile; one the user started for a session or a few ends and says
|
|
1321
1345
|
// when. Tasks the user named are never held.
|
|
1322
1346
|
const back = i < picked.length || historyOnly ? undefined : nextAwake(tree, { ...(research ? { research: research.id } : {}), strategy: ctx.settings.strategy(tree.config) }, others);
|
|
1347
|
+
// Nothing now but tasks whose site's pages for the agents' web tools are used up here: the run waits for the
|
|
1348
|
+
// first of them to have enough free (no agent, nothing asked of any archive) — a run that goes on by itself;
|
|
1349
|
+
// one that ends before then, or one the user started for a session or a few, ends and says when.
|
|
1350
|
+
const web = i < picked.length ? undefined : [...webOut.values()].sort((a, b) => a.until - b.until)[0];
|
|
1351
|
+
if (web && !(back && back.until < web.until)) {
|
|
1352
|
+
const at = web.until + 1000; // its oldest page out of the window, and a second for the clock
|
|
1353
|
+
const values = { site: web.site, at: clockUp(web.until) };
|
|
1354
|
+
if (gateHolds && !(until && at > until)) {
|
|
1355
|
+
out(ui(lang, "ui.run.web.wait", values));
|
|
1356
|
+
stopAwake(); // nothing to do meanwhile: the computer may sleep
|
|
1357
|
+
markPaused(root, worker, { until: new Date(at).toISOString(), reason: ui(lang, "ui.run.web.why", values) });
|
|
1358
|
+
try {
|
|
1359
|
+
await pause(at - Date.now(), stopWaits);
|
|
1360
|
+
}
|
|
1361
|
+
finally {
|
|
1362
|
+
markPaused(root, worker, undefined);
|
|
1363
|
+
}
|
|
1364
|
+
stopAwake = keepAwake(ctx.env);
|
|
1365
|
+
if (stop.signal.aborted || finishing || stopAsked) {
|
|
1366
|
+
stopCode = "user";
|
|
1367
|
+
break;
|
|
1368
|
+
}
|
|
1369
|
+
i--; // this was no session: the queue again, as it is then
|
|
1370
|
+
continue;
|
|
1371
|
+
}
|
|
1372
|
+
stopCode = "web";
|
|
1373
|
+
stopValues = values;
|
|
1374
|
+
break;
|
|
1375
|
+
}
|
|
1323
1376
|
if (back) {
|
|
1324
1377
|
const at = back.until + 1000; // its time off over, and a second for the clock
|
|
1325
1378
|
const values = { host: back.host, at: clockUp(back.until) };
|
package/dist/commands/setup.js
CHANGED
|
@@ -556,7 +556,7 @@ function diagnoseInto(ctx, checks, t, add, progress, pre = {}) {
|
|
|
556
556
|
}
|
|
557
557
|
// Archives through the browser: only Claude Code has browser tools, and they work through the Claude in Chrome extension.
|
|
558
558
|
// Claude's app without Claude Code in the terminal: its conversation has Claude in Chrome, a run of strom's
|
|
559
|
-
// (strom run
|
|
559
|
+
// (strom run) does not — said beside the extension found
|
|
560
560
|
const appOnly = chosen === "claude" && appWithoutCli("claude", ctx.env) ? t("ui.doc.browser.apponly", { app: DESKTOP_APPS.claude.name, cli: PROFILES.claude.name }) : "";
|
|
561
561
|
const shared = ctx.settings.shared()?.value;
|
|
562
562
|
const viaBrowser = shared ? timed("doctor.browser", () => browserConnectors(ctx.env, shared)) : [];
|