isorite 0.10.0 → 0.12.0
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/README.md +2 -5
- package/dist/core.js +184 -13
- package/dist/main.js +1018 -200
- package/docs/setup-for-agents.md +11 -36
- package/docs/setup.md +20 -61
- package/docs/terminal.md +28 -80
- package/package.json +2 -1
- package/web/_app/immutable/assets/0.BXPxx6Q0.css +1 -0
- package/web/_app/immutable/assets/5.rBvyRuST.css +1 -0
- package/web/_app/immutable/assets/{7.ljiu9bn5.css → 7.C00vyVPo.css} +1 -1
- package/web/_app/immutable/assets/Drawing.Q7J9MyIo.css +1 -0
- package/web/_app/immutable/assets/NoteEditor.S3q5lmKq.css +1 -0
- package/web/_app/immutable/assets/{NoteList.F579Zvj_.css → NoteList.E6jC-AtZ.css} +1 -1
- package/web/_app/immutable/assets/Timeline.LsRXYIBv.css +1 -0
- package/web/_app/immutable/assets/ground.hxi5N5fC.css +1 -0
- package/web/_app/immutable/chunks/4kgFUGOH.js +1 -0
- package/web/_app/immutable/chunks/8SS1q0nk.js +7 -0
- package/web/_app/immutable/chunks/{C5MPRibb.js → BK6pLgdi.js} +1 -1
- package/web/_app/immutable/chunks/{CiU6tYJv.js → Bk_JinGf.js} +1 -1
- package/web/_app/immutable/chunks/CFEI5lV9.js +1 -0
- package/web/_app/immutable/chunks/{6RXH8WsD.js → CiMp12cC.js} +1 -1
- package/web/_app/immutable/chunks/{BcgO-fBX.js → D4YEq54N.js} +1 -1
- package/web/_app/immutable/chunks/{CsRPJjQS.js → DDCg82xL.js} +1 -1
- package/web/_app/immutable/chunks/DThNJvmp.js +1 -0
- package/web/_app/immutable/chunks/{DQjIi5Jv.js → D_jbSWJl.js} +1 -1
- package/web/_app/immutable/chunks/DbeMVOH4.js +1 -0
- package/web/_app/immutable/chunks/DsQj0LyB.js +523 -0
- package/web/_app/immutable/chunks/{CBkjDkEN.js → Uo6irDQW.js} +80 -79
- package/web/_app/immutable/chunks/{DCD8_jrW.js → jTXVas70.js} +1 -1
- package/web/_app/immutable/entry/app.CvK8zypr.js +2 -0
- package/web/_app/immutable/entry/start.Dcgm6sQd.js +1 -0
- package/web/_app/immutable/nodes/0.0TdRBEoR.js +26 -0
- package/web/_app/immutable/nodes/{1.rzuq9VRh.js → 1.Dchqgt4j.js} +1 -1
- package/web/_app/immutable/nodes/2.C0CMUdSu.js +1 -0
- package/web/_app/immutable/nodes/3.MjtWDMWd.js +1 -0
- package/web/_app/immutable/nodes/4.hhS0SQta.js +2 -0
- package/web/_app/immutable/nodes/5.C33_cw2J.js +9 -0
- package/web/_app/immutable/nodes/6.owNfwwRl.js +1 -0
- package/web/_app/immutable/nodes/7.BpxHVHoY.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/index.html +20 -18
- package/web/kit/chart.js +55 -0
- package/web/kit/isorite.css +32 -0
- package/web/kit/kit.css +80 -0
- package/web/kit/kit.js +543 -0
- package/web/kit/licenses/d3.txt +13 -0
- package/web/kit/licenses/interval-tree-1d.txt +22 -0
- package/web/kit/licenses/isoformat.txt +13 -0
- package/web/kit/licenses/katex.txt +21 -0
- package/web/kit/licenses/observablehq-plot.txt +13 -0
- package/web/kit/licenses/three.txt +21 -0
- package/web/kit/math.css +1 -0
- package/web/kit/math.js +257 -0
- package/web/kit/model.js +4236 -0
- package/web/kit/plain.css +16 -0
- package/web/_app/immutable/assets/0.CPW9fjPu.css +0 -1
- package/web/_app/immutable/assets/5.TsqJFEFF.css +0 -1
- package/web/_app/immutable/assets/NoteEditor.Wt5vU9Tb.css +0 -1
- package/web/_app/immutable/assets/Timeline.KTc3LKuK.css +0 -1
- package/web/_app/immutable/chunks/B0A4Snxv.js +0 -6
- package/web/_app/immutable/chunks/B8Qvvm53.js +0 -1
- package/web/_app/immutable/chunks/BJo70SOc.js +0 -1
- package/web/_app/immutable/chunks/BYSDTLqw.js +0 -1
- package/web/_app/immutable/chunks/BimZp6R0.js +0 -523
- package/web/_app/immutable/chunks/DlKQFacy.js +0 -1
- package/web/_app/immutable/chunks/c7PFFMl4.js +0 -1
- package/web/_app/immutable/entry/app.iw6ZIOh2.js +0 -2
- package/web/_app/immutable/entry/start.CFnKMSWs.js +0 -1
- package/web/_app/immutable/nodes/0.BzEgwgsa.js +0 -26
- package/web/_app/immutable/nodes/2.D_jWsQLW.js +0 -1
- package/web/_app/immutable/nodes/3.BzRx3SiD.js +0 -1
- package/web/_app/immutable/nodes/4.DP2MGav1.js +0 -2
- package/web/_app/immutable/nodes/5.BPS-CCQT.js +0 -5
- package/web/_app/immutable/nodes/6.DQMCyNJ3.js +0 -1
- package/web/_app/immutable/nodes/7.MWEn-qPC.js +0 -1
package/README.md
CHANGED
|
@@ -9,8 +9,7 @@ npm install -g isorite
|
|
|
9
9
|
isorite guide # the guide: a knowledge base about isorite, with things to do, in ~/isorite-guide
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
On your own notes, a folder of Markdown files (`isorite new <notes>` starts one). They're drawn as you write them:
|
|
13
|
-
maths, code coloured by its language, and Mermaid diagrams.
|
|
12
|
+
On your own notes, a folder of Markdown files (`isorite new <notes>` starts one). They're drawn as you write them: maths, code coloured by its language, and Mermaid diagrams.
|
|
14
13
|
|
|
15
14
|
```sh
|
|
16
15
|
isorite serve <notes> # the browser, at http://localhost:4767/; set up Iso's provider in Iso's settings
|
|
@@ -19,9 +18,7 @@ isorite model # optional: search by meaning (fetches a 53 MB model
|
|
|
19
18
|
isorite memory # optional: the agent's memory, a base of its own lent to every session
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
Setting it up, at work too (a company's gateway, a client certificate, a proxy): `docs/setup.md` in this package.
|
|
23
|
-
When something fails, `isorite doctor` says what to change; `isorite doctor --report` gives it as one block, its
|
|
24
|
-
secrets hidden, to paste to someone helping. For an AI helping you: `isorite help setup`.
|
|
21
|
+
Setting it up, at work too (a company's gateway, a client certificate, a proxy): `docs/setup.md` in this package. When something fails, `isorite doctor` says what to change; `isorite doctor --report` gives it as one block, its secrets hidden, to paste to someone helping. For an AI helping you: `isorite help setup`.
|
|
25
22
|
|
|
26
23
|
The guide in a browser alone: https://lachlanjs.github.io/isorite/
|
|
27
24
|
|
package/dist/core.js
CHANGED
|
@@ -440,6 +440,38 @@ const pictureType = (path) => {
|
|
|
440
440
|
const dot = path.lastIndexOf(".");
|
|
441
441
|
return dot < 0 || path.lastIndexOf("/") > dot ? null : TYPES[path.slice(dot + 1).toLowerCase()] ?? null;
|
|
442
442
|
};
|
|
443
|
+
const OTHER = {
|
|
444
|
+
html: "text/html",
|
|
445
|
+
htm: "text/html",
|
|
446
|
+
csv: "text/csv",
|
|
447
|
+
tsv: "text/tab-separated-values",
|
|
448
|
+
json: "application/json",
|
|
449
|
+
jsonl: "application/jsonl",
|
|
450
|
+
ndjson: "application/x-ndjson",
|
|
451
|
+
txt: "text/plain",
|
|
452
|
+
tex: "text/plain",
|
|
453
|
+
pdf: "application/pdf",
|
|
454
|
+
glb: "model/gltf-binary",
|
|
455
|
+
gltf: "model/gltf+json",
|
|
456
|
+
stl: "model/stl",
|
|
457
|
+
obj: "model/obj",
|
|
458
|
+
zip: "application/zip",
|
|
459
|
+
parquet: "application/vnd.apache.parquet",
|
|
460
|
+
arrow: "application/vnd.apache.arrow.file",
|
|
461
|
+
npy: "application/octet-stream",
|
|
462
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
463
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
464
|
+
epub: "application/epub+zip",
|
|
465
|
+
odt: "application/vnd.oasis.opendocument.text"
|
|
466
|
+
};
|
|
467
|
+
/** Any file's media type in the notes (M23), by its extension: a picture's, one listed, or octet-stream. Null for a
|
|
468
|
+
* note (Markdown is read as a note, never as a file) and for a path with no extension. */
|
|
469
|
+
const fileType = (path) => {
|
|
470
|
+
const dot = path.lastIndexOf(".");
|
|
471
|
+
if (dot < 0 || path.lastIndexOf("/") > dot) return null;
|
|
472
|
+
const ext = path.slice(dot + 1).toLowerCase();
|
|
473
|
+
return ext === "md" ? null : pictureType(path) ?? OTHER[ext] ?? "application/octet-stream";
|
|
474
|
+
};
|
|
443
475
|
/** Width and height in pixels, or null. */
|
|
444
476
|
function pictureSize(bytes, type) {
|
|
445
477
|
const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), n = bytes.length;
|
|
@@ -584,10 +616,19 @@ function outwardLinks(body) {
|
|
|
584
616
|
/** The base's own instructions, for Iso and any other agent, at the top of the notes (M15). Not a note. */
|
|
585
617
|
const AGENTS_FILE = "AGENTS.md";
|
|
586
618
|
const OKF_VERSION = "0.2";
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
619
|
+
const KINDS$2 = [
|
|
620
|
+
["artifact", /\.html?$/i],
|
|
621
|
+
["image", /\.(png|jpe?g|gif|svg|webp|avif)$/i],
|
|
622
|
+
["data", /\.(csv|tsv|json|jsonl|ndjson|parquet|arrow|feather|npy|npz|xlsx|xls|h5|hdf5|nc)$/i],
|
|
623
|
+
["document", /\.(pdf|docx?|odt|rtf|epub|pptx?|odp|txt|tex)$/i]
|
|
624
|
+
];
|
|
625
|
+
/** What kind of file a path is: null for a note, or a path with no extension (a note or a folder named without one);
|
|
626
|
+
* anything not listed is misc rather than dropped. */
|
|
627
|
+
const citeKind = (path) => {
|
|
628
|
+
const name = basename(path);
|
|
629
|
+
if (/\.md$/i.test(name) || !/\.[^.]+$/.test(name.replace(/^\./, ""))) return null;
|
|
630
|
+
return KINDS$2.find(([, re]) => re.test(name))?.[0] ?? "misc";
|
|
631
|
+
};
|
|
591
632
|
const isEntry = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
592
633
|
var Concept = class {
|
|
593
634
|
id;
|
|
@@ -1160,6 +1201,76 @@ function spliceText(before, changes, body) {
|
|
|
1160
1201
|
return bom + head + newBody;
|
|
1161
1202
|
}
|
|
1162
1203
|
//#endregion
|
|
1204
|
+
//#region packages/core/src/unwrap.ts
|
|
1205
|
+
const ITEM = /^\s*([-*+]|\d+[.)])\s+/;
|
|
1206
|
+
const APART = /^\s*(#{1,6}\s|\||<|```|~~~|\$\$|>|---\s*$|\*\*\*\s*$|___\s*$|\[[^\]]+\]:\s)/;
|
|
1207
|
+
const QUOTED = /^\s*>\s?\S/;
|
|
1208
|
+
function unwrap(text) {
|
|
1209
|
+
const lines = text.split("\n"), out = [];
|
|
1210
|
+
let i = 0, fence = "", maths = false;
|
|
1211
|
+
/** What the last line written may be continued by: prose, a quoted line, or nothing. */
|
|
1212
|
+
let open = "";
|
|
1213
|
+
if (lines[0] === "---") {
|
|
1214
|
+
const end = lines.indexOf("---", 1);
|
|
1215
|
+
if (end > 0) {
|
|
1216
|
+
out.push(...lines.slice(0, end + 1));
|
|
1217
|
+
i = end + 1;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
for (; i < lines.length; i++) {
|
|
1221
|
+
const l = lines[i], t = l.trim();
|
|
1222
|
+
if (fence) {
|
|
1223
|
+
out.push(l);
|
|
1224
|
+
if (t.startsWith(fence)) fence = "";
|
|
1225
|
+
continue;
|
|
1226
|
+
}
|
|
1227
|
+
if (maths) {
|
|
1228
|
+
out.push(l);
|
|
1229
|
+
if (t.endsWith("$$")) maths = false;
|
|
1230
|
+
continue;
|
|
1231
|
+
}
|
|
1232
|
+
if (t.startsWith("```") || t.startsWith("~~~")) {
|
|
1233
|
+
fence = t.slice(0, 3);
|
|
1234
|
+
out.push(l);
|
|
1235
|
+
open = "";
|
|
1236
|
+
continue;
|
|
1237
|
+
}
|
|
1238
|
+
if (t.startsWith("$$") && !t.slice(2).includes("$$")) {
|
|
1239
|
+
maths = true;
|
|
1240
|
+
out.push(l);
|
|
1241
|
+
open = "";
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
if (!t) {
|
|
1245
|
+
out.push(l);
|
|
1246
|
+
open = "";
|
|
1247
|
+
continue;
|
|
1248
|
+
}
|
|
1249
|
+
const hard = /( {2}|\\)$/.test(out.at(-1) ?? "");
|
|
1250
|
+
if (APART.test(l)) {
|
|
1251
|
+
if (open === "quote" && QUOTED.test(l) && !/^\s*>\s*([-*+]|\d+[.)]|#)/.test(l) && !hard) {
|
|
1252
|
+
out[out.length - 1] += " " + l.replace(/^\s*>\s?/, "").trim();
|
|
1253
|
+
continue;
|
|
1254
|
+
}
|
|
1255
|
+
out.push(l);
|
|
1256
|
+
open = QUOTED.test(l) ? "quote" : "";
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
if (ITEM.test(l)) {
|
|
1260
|
+
out.push(l);
|
|
1261
|
+
open = "prose";
|
|
1262
|
+
continue;
|
|
1263
|
+
}
|
|
1264
|
+
if (open === "prose" && !hard) {
|
|
1265
|
+
out[out.length - 1] += " " + t;
|
|
1266
|
+
continue;
|
|
1267
|
+
}
|
|
1268
|
+
out.push(l);
|
|
1269
|
+
open = open === "" && /^( {4}|\t)/.test(l) ? "" : "prose";
|
|
1270
|
+
}
|
|
1271
|
+
return out.join("\n");
|
|
1272
|
+
}
|
|
1273
|
+
//#endregion
|
|
1163
1274
|
//#region packages/core/src/search.ts
|
|
1164
1275
|
const TOKEN = /[a-z0-9]+(?:['’][a-z]+)?/g;
|
|
1165
1276
|
const STOP = new Set("a an and are as at be by for from has have in is it its of on or that the this to was were will with not but if then than so do does did can could should would into about".split(" "));
|
|
@@ -1606,6 +1717,8 @@ const KINDS$1 = [
|
|
|
1606
1717
|
];
|
|
1607
1718
|
const SNAPSHOT_EVERY = 40;
|
|
1608
1719
|
const SESSION_GAP_MS = 18e5;
|
|
1720
|
+
/** Your edits in a row are one moment, one layer of a note's history (M24, T), until 10 minutes pass with none. */
|
|
1721
|
+
const LAYER_IDLE_MS = 6e5;
|
|
1609
1722
|
const hashText = (text) => sha256(text).slice(0, 16);
|
|
1610
1723
|
/** A stamp for a new entry. `last` is the newest entry anywhere in the study base, which decides the session. */
|
|
1611
1724
|
function stamp(who, device, last, now = Date.now()) {
|
|
@@ -1958,16 +2071,21 @@ function insertAt(note, line) {
|
|
|
1958
2071
|
before: prev + 1 < all.length ? anchorOf(all, prev + 1) : null
|
|
1959
2072
|
};
|
|
1960
2073
|
}
|
|
1961
|
-
/** The journal as the timeline shows it. Your own edits in a row within a session are one moment
|
|
1962
|
-
* one moment whose `what` says how it ended. Revisions are not
|
|
2074
|
+
/** The journal as the timeline shows it. Your own edits in a row within a session are one moment, until ten minutes
|
|
2075
|
+
* pass with none (LAYER_IDLE_MS); a proposal is one moment whose `what` says how it ended. Revisions are not
|
|
2076
|
+
* moments. */
|
|
1963
2077
|
function moments(entries) {
|
|
1964
2078
|
const out = [], offered = /* @__PURE__ */ new Map(), asked = /* @__PURE__ */ new Map();
|
|
2079
|
+
/** Lines a change put in and took out: a note's first entry, all of its text. */
|
|
2080
|
+
const size = (c) => c.why === "start" || !c.hunks.length && c.before === null ? [(c.text ?? "").split("\n").length, 0] : [c.hunks.reduce((n, h) => n + h.ins.length, 0), c.hunks.reduce((n, h) => n + h.del.length, 0)];
|
|
1965
2081
|
for (const e of entries) {
|
|
1966
2082
|
const base = {
|
|
1967
2083
|
ids: [e.id],
|
|
1968
2084
|
at: e.at,
|
|
1969
2085
|
session: e.session,
|
|
1970
|
-
who: e.who
|
|
2086
|
+
who: e.who,
|
|
2087
|
+
added: 0,
|
|
2088
|
+
removed: 0
|
|
1971
2089
|
};
|
|
1972
2090
|
if (e.kind === "proposal") {
|
|
1973
2091
|
const m = {
|
|
@@ -1986,22 +2104,29 @@ function moments(entries) {
|
|
|
1986
2104
|
}
|
|
1987
2105
|
} else if (e.kind === "change") {
|
|
1988
2106
|
const m = e.proposal ? offered.get(e.proposal) : void 0;
|
|
2107
|
+
const [added, removed] = size(e);
|
|
1989
2108
|
if (e.why === "keep" && m) {
|
|
1990
2109
|
m.what = "kept";
|
|
1991
2110
|
m.ids.push(e.id);
|
|
1992
2111
|
m.at = e.at;
|
|
2112
|
+
m.added += added;
|
|
2113
|
+
m.removed += removed;
|
|
1993
2114
|
continue;
|
|
1994
2115
|
}
|
|
1995
2116
|
const last = out[out.length - 1];
|
|
1996
|
-
if (e.why === "edit" && last && last.what === "edited" && last.who === e.who && last.session === e.session) {
|
|
2117
|
+
if (e.why === "edit" && last && last.what === "edited" && last.who === e.who && last.session === e.session && Date.parse(e.at) - Date.parse(last.at) <= 6e5) {
|
|
1997
2118
|
last.ids.push(e.id);
|
|
1998
2119
|
last.at = e.at;
|
|
2120
|
+
last.added += added;
|
|
2121
|
+
last.removed += removed;
|
|
1999
2122
|
continue;
|
|
2000
2123
|
}
|
|
2001
2124
|
const what = e.why === "start" ? e.who === "external" ? "found" : "wrote" : e.why === "edit" ? "edited" : e.why === "restore" ? "restored" : e.why === "keep" ? "kept" : e.why === "move" ? "moved" : "changed elsewhere";
|
|
2002
2125
|
out.push({
|
|
2003
2126
|
...base,
|
|
2004
2127
|
what,
|
|
2128
|
+
added,
|
|
2129
|
+
removed,
|
|
2005
2130
|
...e.asked ? { asked: e.asked } : {}
|
|
2006
2131
|
});
|
|
2007
2132
|
}
|
|
@@ -2096,8 +2221,8 @@ function checkId(id) {
|
|
|
2096
2221
|
if (!SAFE.test(id) || id.startsWith("/") || id.split("/").some((part) => part === ".." || part === "." || !part)) throw new Error(`not a note's id: ${JSON.stringify(id)}`);
|
|
2097
2222
|
return id;
|
|
2098
2223
|
}
|
|
2099
|
-
/** Where a note's journal is. Drafts
|
|
2100
|
-
* `@understanding/`
|
|
2224
|
+
/** Where a note's journal is. Drafts are journalled under their `@draft/` ids (and Understanding notes were, before
|
|
2225
|
+
* M24, under `@understanding/`). */
|
|
2101
2226
|
const journalPath = (noteId) => `journal/${checkId(noteId)}.jsonl`;
|
|
2102
2227
|
/** This device's record of usage: what was cleared from Iso's context, and what each turn cost (record.ts). */
|
|
2103
2228
|
const recordPath = (device) => `record/${checkId(device)}.jsonl`;
|
|
@@ -2159,10 +2284,54 @@ function mapModel(base) {
|
|
|
2159
2284
|
]);
|
|
2160
2285
|
}
|
|
2161
2286
|
const holdsFiles = /* @__PURE__ */ new Set();
|
|
2162
|
-
|
|
2287
|
+
const parentOf = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/")) : "";
|
|
2288
|
+
for (const f of base.files) holdsFiles.add(parentOf(f));
|
|
2289
|
+
const pictureFolder = (d) => {
|
|
2290
|
+
const dd = base.directories.get(d);
|
|
2291
|
+
const here = [...base.files].filter((f) => parentOf(f) === d);
|
|
2292
|
+
return !!d && (!dd || !dd.concepts.length && !dd.children.length) && here.length > 0 && here.every((f) => citeKind(f) === "image");
|
|
2293
|
+
};
|
|
2294
|
+
const refOf = (f) => citeKind(f) === "image" && pictureFolder(parentOf(f)) ? parentOf(f) + "/" : f;
|
|
2295
|
+
const fileEdges = /* @__PURE__ */ new Map();
|
|
2296
|
+
for (const c of base.concepts.values()) for (const x of c.cites) {
|
|
2297
|
+
if (x.broken || !base.files.has(x.target)) continue;
|
|
2298
|
+
const ref = refOf(x.target);
|
|
2299
|
+
if (!fileEdges.has(c.id)) fileEdges.set(c.id, /* @__PURE__ */ new Set());
|
|
2300
|
+
fileEdges.get(c.id).add(ref);
|
|
2301
|
+
}
|
|
2302
|
+
const rankOf = /* @__PURE__ */ new Map();
|
|
2303
|
+
for (const [from, refs] of fileEdges) for (const ref of refs) {
|
|
2304
|
+
edges.push([
|
|
2305
|
+
from,
|
|
2306
|
+
ref,
|
|
2307
|
+
STRENGTH.uses
|
|
2308
|
+
]);
|
|
2309
|
+
rankOf.set(ref, Math.max(rankOf.get(ref) ?? 0, order.get(from)?.depth ?? 0));
|
|
2310
|
+
}
|
|
2311
|
+
const filesIn = /* @__PURE__ */ new Map();
|
|
2312
|
+
for (const f of [...base.files].sort()) {
|
|
2313
|
+
const of = citeKind(f), ref = of ? refOf(f) : null;
|
|
2314
|
+
if (!of || !ref) continue;
|
|
2315
|
+
const at = ref.endsWith("/") ? parentOf(ref.slice(0, -1)) : parentOf(f);
|
|
2316
|
+
const list = filesIn.get(at) ?? [];
|
|
2317
|
+
if (!list.some((n) => n.ref === ref)) list.push({
|
|
2318
|
+
kind: "concept",
|
|
2319
|
+
id: "f:" + ref,
|
|
2320
|
+
ref,
|
|
2321
|
+
weight: 1,
|
|
2322
|
+
rank: rankOf.get(ref) ?? 0,
|
|
2323
|
+
of
|
|
2324
|
+
});
|
|
2325
|
+
filesIn.set(at, list);
|
|
2326
|
+
}
|
|
2163
2327
|
const dir = (id) => {
|
|
2164
2328
|
const d = base.directories.get(id);
|
|
2165
|
-
|
|
2329
|
+
if (id && pictureFolder(id)) return null;
|
|
2330
|
+
const children = [
|
|
2331
|
+
...[...d.children].sort().map(dir).filter((c) => c !== null),
|
|
2332
|
+
...[...d.concepts].sort().map(note),
|
|
2333
|
+
...filesIn.get(id) ?? []
|
|
2334
|
+
];
|
|
2166
2335
|
return id && !children.length && (holdsFiles.has(id) || d.children.length) ? null : {
|
|
2167
2336
|
kind: "dir",
|
|
2168
2337
|
id: "d:" + id,
|
|
@@ -2175,6 +2344,8 @@ function mapModel(base) {
|
|
|
2175
2344
|
edges
|
|
2176
2345
|
};
|
|
2177
2346
|
}
|
|
2347
|
+
/** Whether a map item is a file (M23), not a note: its ref has an extension, or is a folder of pictures. */
|
|
2348
|
+
const isFileRef = (ref) => ref.endsWith("/") || citeKind(ref) !== null;
|
|
2178
2349
|
/** What lights when a note is chosen on the Atlas (refs, as the map model names notes). Where the base rates its
|
|
2179
2350
|
* links, only "requires" is followed back; where it rates none, every drawn link is. */
|
|
2180
2351
|
function reach(model, note) {
|
|
@@ -2290,4 +2461,4 @@ function ago(at, now = Date.now()) {
|
|
|
2290
2461
|
/** A moment is named by its last entry: the one the note is shown at. */
|
|
2291
2462
|
const momentKey = (m) => m.ids.at(-1);
|
|
2292
2463
|
//#endregion
|
|
2293
|
-
export { ABOUT, AGENTS_FILE, Bundle, CONFIG_FILE, Concept, DEVICE_RE, DONE, DiffError, Directory, FrontmatterError, GITATTRIBUTES, ID_RE, KINDS, LearnerError, MAX_EVENT_BYTES, OKF_VERSION, OWN_DIR, OWN_FORMAT, RATINGS, SESSION_GAP_MS, SETTINGS_FILE, SNAPSHOT_EVERY, STRENGTH, STUDY_DIR, STUDY_FORMAT, SearchIndex, StudyError, agentName, ago, anchorOf, applyHunks, authors, blocks, change, citeKind, cleanEvent, cmp, cmpTuple, codeTarget, contentHash, describe, diffLines, doneOf, dumpFrontmatter, editFrontmatter, embedFor, embedRefs, findAnchor, findPassage, floatRepr, frontmatterText, hashText, headings, idsOf, impliedLinks, insertAt, iso, journalLine, journalPath, kindOf, legacyId, linkRefs, linkTexts, locate, mapModel, mergeRecords, momentKey, moments, newId, noteIds, outwardLinks, pagerank, parseSettings, parseStudyConfig, parseYaml, passageOf, pending, pictureSize, pictureType, pyRepr, rating, reach, readJournal, readRecord, reconcile, recordPath, replay, round3, section, sessionMoments, settingsText, sha256, slugify, snippet, spliceText, splitFrontmatter, splitSource, stamp, strengthEdges, strip, stronglyConnected, text, textAt, toTime, tokenize, touched, wordAuthors, written };
|
|
2464
|
+
export { ABOUT, AGENTS_FILE, Bundle, CONFIG_FILE, Concept, DEVICE_RE, DONE, DiffError, Directory, FrontmatterError, GITATTRIBUTES, ID_RE, KINDS, LAYER_IDLE_MS, LearnerError, MAX_EVENT_BYTES, OKF_VERSION, OWN_DIR, OWN_FORMAT, RATINGS, SESSION_GAP_MS, SETTINGS_FILE, SNAPSHOT_EVERY, STRENGTH, STUDY_DIR, STUDY_FORMAT, SearchIndex, StudyError, agentName, ago, anchorOf, applyHunks, authors, blocks, change, citeKind, cleanEvent, cmp, cmpTuple, codeTarget, contentHash, describe, diffLines, doneOf, dumpFrontmatter, editFrontmatter, embedFor, embedRefs, fileType, findAnchor, findPassage, floatRepr, frontmatterText, hashText, headings, idsOf, impliedLinks, insertAt, isFileRef, iso, journalLine, journalPath, kindOf, legacyId, linkRefs, linkTexts, locate, mapModel, mergeRecords, momentKey, moments, newId, noteIds, outwardLinks, pagerank, parseSettings, parseStudyConfig, parseYaml, passageOf, pending, pictureSize, pictureType, pyRepr, rating, reach, readJournal, readRecord, reconcile, recordPath, replay, round3, section, sessionMoments, settingsText, sha256, slugify, snippet, spliceText, splitFrontmatter, splitSource, stamp, strengthEdges, strip, stronglyConnected, text, textAt, toTime, tokenize, touched, unwrap, wordAuthors, written };
|