visualproof 0.6.0 → 0.7.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 -2
- package/dist/extractor/Extract.lean +13 -3
- package/dist/server/agent.js +102 -2879
- package/dist/server/agentactivity.js +72 -0
- package/dist/server/agentadvice.js +115 -0
- package/dist/server/agentdocs.js +1 -1
- package/dist/server/agententry.js +180 -0
- package/dist/server/agentexport.js +469 -0
- package/dist/server/agentfollow.js +384 -0
- package/dist/server/agentgraph.js +128 -0
- package/dist/server/agentlean.js +144 -0
- package/dist/server/agentlibrary.js +1 -1
- package/dist/server/agentplaces.js +242 -0
- package/dist/server/agentread.js +569 -0
- package/dist/server/agenttalk.js +282 -0
- package/dist/server/agenttcb.js +378 -0
- package/dist/server/agentviews.js +2 -2
- package/dist/server/app.js +377 -0
- package/dist/server/appaccess.js +127 -0
- package/dist/server/appagent.js +110 -0
- package/dist/server/appgraph.js +176 -0
- package/dist/server/appshare.js +179 -0
- package/dist/server/appsite.js +120 -0
- package/dist/server/apptalk.js +178 -0
- package/dist/server/artcmd.js +1 -1
- package/dist/server/events.js +1 -1
- package/dist/server/history.js +51 -3
- package/dist/server/historyapi.js +34 -2
- package/dist/server/hover.js +11 -7
- package/dist/server/identity.js +1 -1
- package/dist/server/libraryroute.js +3 -3
- package/dist/server/live.js +61 -2
- package/dist/server/main.js +17 -1746
- package/dist/server/options.js +350 -0
- package/dist/server/outside.js +311 -0
- package/dist/server/pastdoc.js +22 -3
- package/dist/server/project.js +28 -4
- package/dist/server/send.js +259 -0
- package/dist/server/talk.js +13 -7
- package/dist/server/tokens.js +3 -3
- package/dist/server/view.js +3 -1
- package/dist/server/views.js +1 -1
- package/dist/shared/artrecipe.js +3 -3
- package/dist/shared/collab.js +1 -1
- package/dist/shared/comment.js +1 -1
- package/dist/shared/doc/build.js +30 -14
- package/dist/shared/doc/latex.js +7 -2
- package/dist/shared/doc/model.js +4 -2
- package/dist/shared/doc/sections.js +21 -4
- package/dist/shared/outside.js +16 -0
- package/dist/shared/pastgraph.js +11 -2
- package/dist/shared/scope.js +1 -1
- package/dist/web/bundle/app.js +49580 -49284
- package/dist/web/src/selection.js +1 -1
- package/dist/web/src/theme.js +1 -1
- package/dist/web/src/visitors.js +1 -1
- package/docs/agent-api/export.md +8 -5
- package/docs/agent-api/history.md +3 -1
- package/docs/agent-api/reading.md +8 -2
- package/package.json +1 -1
package/dist/shared/doc/latex.js
CHANGED
|
@@ -204,6 +204,9 @@ function blocks(bs) {
|
|
|
204
204
|
/** What is said under the code of a declaration of a past build whose text of then is not kept
|
|
205
205
|
* (ExportSpec decision 16): its statement as the build recorded it is printed instead. */
|
|
206
206
|
export const NOT_KEPT_NOTE = "Its source text at this build is not kept: printed is its statement, as the build recorded it.";
|
|
207
|
+
/** The same of a declaration outside the project (HistorySpec decision 24): outside sources are not
|
|
208
|
+
* kept per build, and its package is at another revision now; the build kept no statement of it. */
|
|
209
|
+
export const OUTSIDE_NOT_KEPT_NOTE = "Its source at this build was not kept: outside sources are not kept per build, and its package is at another revision now.";
|
|
207
210
|
/** A declaration: its head, its full name and place, what it is, its code. `level`: its PDF
|
|
208
211
|
* bookmark's, one below its section's. */
|
|
209
212
|
function decl(d, level, refs = new Map()) {
|
|
@@ -212,12 +215,14 @@ function decl(d, level, refs = new Map()) {
|
|
|
212
215
|
out.push(`\\vpBookmark{${id}}{${int(level)}}{${escapeLatex(bookmarkText(d.short))}}`);
|
|
213
216
|
out.push(`\\begin{vpDecl}{${id}}{${escapeLatex(d.short)}}{${escapeLatex(d.kind)}}`);
|
|
214
217
|
out.push(`\\vpFullName{${escapeName(d.name)}}`);
|
|
215
|
-
|
|
218
|
+
// outside the project, its file in its package, the package named (ExportSpec decision 8)
|
|
219
|
+
const file = d.file ? `${d.file}${d.package ? ` (${d.package})` : ""}` : "";
|
|
220
|
+
out.push(`\\vpPlace{${escapeName(d.module)}}{${file ? escapePath(file) : ""}}{${d.line ? int(d.line) : ""}}`);
|
|
216
221
|
if (d.doc)
|
|
217
222
|
out.push(`\\begin{vpDocstring}`, blocks(d.doc), `\\end{vpDocstring}`);
|
|
218
223
|
out.push(code(d.code));
|
|
219
224
|
if (d.code.notKept)
|
|
220
|
-
out.push(`\\vpDeclNote{${escapeLatex(NOT_KEPT_NOTE)}}`);
|
|
225
|
+
out.push(`\\vpDeclNote{${escapeLatex(d.external ? OUTSIDE_NOT_KEPT_NOTE : NOT_KEPT_NOTE)}}`);
|
|
221
226
|
if (d.papers)
|
|
222
227
|
out.push(papers(d.papers, refs));
|
|
223
228
|
// the notes attached to it, as its explanation
|
package/dist/shared/doc/model.js
CHANGED
|
@@ -33,5 +33,7 @@
|
|
|
33
33
|
* (2026-10-12): the board's order, a section's declarations, notes and sections in one list
|
|
34
34
|
* (`items`), the document's first ones too; the notes the view shows (`NoteEntry`), a declaration's
|
|
35
35
|
* own under it (`DeclEntry.notes`), their images and clips as figures; a declaration a note names
|
|
36
|
-
* linked where the document prints it (an inline `decl`).
|
|
37
|
-
|
|
36
|
+
* linked where the document prints it (an inline `decl`). 11 (2026-10-20): a declaration from outside
|
|
37
|
+
* the project that is key for a target printed as the project's are, from its package's source
|
|
38
|
+
* (`DeclEntry.package`; `textCut: "outside"`), the rest of the outside world counted as before. */
|
|
39
|
+
export const DOC_VERSION = 11;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// The exported document's plan (ExportSpec decisions 12 and 13): what a view holds, as the document
|
|
2
2
|
// prints it. Every declaration of the project the board holds is printed, whatever is folded; what
|
|
3
|
-
// the view holds from outside the project is not, and is counted instead
|
|
3
|
+
// the view holds from outside the project is not, and is counted instead — but where it is key for a
|
|
4
|
+
// target (ExportSpec decision 8, the owner's decision of 2026-10-20: key declarations may be outside
|
|
5
|
+
// since 0.6.0), which is printed as the project's are, from its package's source. The sections are the
|
|
4
6
|
// view's cluster structure as the board shows it — its clustering, its hidden levels taken out
|
|
5
7
|
// (ViewSpec decision 24; shared/layout.ts, clusterTree) — each cluster that holds something printed
|
|
6
8
|
// a section, nested by its depth.
|
|
@@ -11,6 +13,7 @@
|
|
|
11
13
|
// in that order, and the Export window (web/src/exportmodal.ts) says from it what the document will
|
|
12
14
|
// hold, so that the two agree.
|
|
13
15
|
import { clusterTree } from "../layout.js";
|
|
16
|
+
import { evaluate } from "../query.js";
|
|
14
17
|
/** Heading levels: section, subsection, subsubsection, then a paragraph-level heading, which every
|
|
15
18
|
* deeper level takes too. */
|
|
16
19
|
export const HEADING_LEVELS = 4;
|
|
@@ -25,13 +28,23 @@ export function tooMuch(count) {
|
|
|
25
28
|
return `This view holds ${count.toLocaleString("en")} declarations of the project; a document prints at most ${MAX_DOC_DECLS.toLocaleString("en")}. Export a narrower view: a namespace or a folder, a target's Key view (key(T)) or the TCB of a target`;
|
|
26
29
|
return null;
|
|
27
30
|
}
|
|
31
|
+
/** The declarations outside the project a document prints (ExportSpec decision 8, the owner's
|
|
32
|
+
* decision of 2026-10-20): those key for a target, each target's marks that its TCB or review set
|
|
33
|
+
* still holds (`key(targets)`, shared/query.ts), per node of `g`. */
|
|
34
|
+
export function outsideKeys(g, d) {
|
|
35
|
+
const key = evaluate({ op: "key", of: "targets" }, { g, review: d });
|
|
36
|
+
for (let i = 0; i < g.projectCount; i++)
|
|
37
|
+
key[i] = 0;
|
|
38
|
+
return key;
|
|
39
|
+
}
|
|
28
40
|
/** The plan of the document of the board that holds `set` (per node of `g`) clustered by `mode`
|
|
29
41
|
* with the levels `hidden` hidden. A cluster that holds no declaration of its own and one section
|
|
30
42
|
* only is merged into it, its heading `A.B`, so that the document has no heading chains with
|
|
31
43
|
* nothing under them; the board merges such a chain into one circle already where it holds nothing
|
|
32
44
|
* else at all. On a board of a past build, `g` is its past graph (shared/pastgraph.ts), which holds
|
|
33
|
-
* that build's declarations alone.
|
|
34
|
-
|
|
45
|
+
* that build's declarations alone. `keyed`: the declarations outside the project that are printed,
|
|
46
|
+
* those key for a target (`outsideKeys`); none where it is left out. */
|
|
47
|
+
export function planDoc(g, set, mode, hidden, keyed = null) {
|
|
35
48
|
// the board's members in the whole graph's order, as a board's graph has them (shared/board.ts)
|
|
36
49
|
const members = [];
|
|
37
50
|
for (let i = 0; i < g.n; i++)
|
|
@@ -42,8 +55,11 @@ export function planDoc(g, set, mode, hidden) {
|
|
|
42
55
|
const top = [];
|
|
43
56
|
const by = new Map();
|
|
44
57
|
let outside = 0;
|
|
58
|
+
let keyOutside = 0;
|
|
45
59
|
members.forEach((i, k) => {
|
|
46
|
-
if (g.isExt(i))
|
|
60
|
+
if (g.isExt(i) && keyed?.[i])
|
|
61
|
+
keyOutside++;
|
|
62
|
+
else if (g.isExt(i)) {
|
|
47
63
|
outside++;
|
|
48
64
|
const lib = g.nodes[i].module.split(".")[0] || g.nodes[i].module;
|
|
49
65
|
by.set(lib, (by.get(lib) ?? 0) + 1);
|
|
@@ -88,6 +104,7 @@ export function planDoc(g, set, mode, hidden) {
|
|
|
88
104
|
sections,
|
|
89
105
|
count: top.length + own.reduce((a, d) => a + d.length, 0),
|
|
90
106
|
sectionCount,
|
|
107
|
+
keyOutside,
|
|
91
108
|
outside: { count: outside, by: [...by].map(([name, count]) => ({ name, count })).sort((a, b) => b.count - a.count || (a.name < b.name ? -1 : 1)) },
|
|
92
109
|
};
|
|
93
110
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// A declaration outside the project, where it is written (ReviewSpec, "The source window", the
|
|
2
|
+
// owner's decision of 2026-10-20): a package of the project's lake-manifest, or Lean's core, as the
|
|
3
|
+
// server finds it (server/outside.ts) and tells the page and the agents with the file's text.
|
|
4
|
+
import { githubBlob } from "./deploy.js";
|
|
5
|
+
/** The package in words, as the window's title bar and the agents say it: `mathlib at 089be84`,
|
|
6
|
+
* `Lean v4.35.0`. */
|
|
7
|
+
export function packageWords(o) {
|
|
8
|
+
if (!o.rev)
|
|
9
|
+
return o.package;
|
|
10
|
+
return o.core ? `${o.package} ${o.rev}` : `${o.package} at ${o.rev.slice(0, 7)}`;
|
|
11
|
+
}
|
|
12
|
+
/** "Open on GitHub" for lines `from` to `to` (from 1) of an outside file: its package's repository at
|
|
13
|
+
* the revision; null where there is none. */
|
|
14
|
+
export function outsideLink(o, from, to) {
|
|
15
|
+
return o.github ? githubBlob(o.github.repo, o.github.rev, o.github.path, from, to) : null;
|
|
16
|
+
}
|
package/dist/shared/pastgraph.js
CHANGED
|
@@ -22,7 +22,7 @@ export const PAST_CHANGED = 4;
|
|
|
22
22
|
/** renamed since: shown under its name then */
|
|
23
23
|
export const PAST_RENAMED = 8;
|
|
24
24
|
/** The git commit of a past build; none where it is not known, or only guessed. Its source is the
|
|
25
|
-
* project's, which the page has now (web/src/
|
|
25
|
+
* project's, which the page has now (web/src/pageart.ts, GET /api/git). */
|
|
26
26
|
function gitThen(commit) {
|
|
27
27
|
if (!commit || commit.guessed)
|
|
28
28
|
return { git: undefined };
|
|
@@ -36,7 +36,16 @@ export function pastGraph(snap, edges, now, diff) {
|
|
|
36
36
|
const thenName = new Map(diff.renamed.map(([a, b]) => [b, a]));
|
|
37
37
|
const removed = new Set(diff.removed);
|
|
38
38
|
const changed = new Set(diff.changed.map((n) => thenName.get(n) ?? n));
|
|
39
|
-
|
|
39
|
+
// a snapshot read before 0.7.0 recorded no place for its outside declarations: where its package
|
|
40
|
+
// is at the same revision now, the place now is the place then, and only there is its source shown
|
|
41
|
+
// (HistorySpec decision 24; the server says which), so it takes the place now
|
|
42
|
+
const nodes = snap.nodes.map((v, i) => {
|
|
43
|
+
if (i < P || v.range)
|
|
44
|
+
return v;
|
|
45
|
+
const j = now.byName.get(v.name);
|
|
46
|
+
const r = j !== undefined && now.isExt(j) ? now.nodes[j].range : undefined;
|
|
47
|
+
return r ? { ...v, range: r } : v;
|
|
48
|
+
});
|
|
40
49
|
const meta = {
|
|
41
50
|
schema: 1,
|
|
42
51
|
layoutVersion: now.meta.layoutVersion,
|
package/dist/shared/scope.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// namespaces and sections around it, the `open` commands (an `open … in` right before it
|
|
3
3
|
// included), the `variable`s, `universe`s, options and section-local commands. The page reads the
|
|
4
4
|
// namespaces and opens to link the short names in a declaration's source (web/src/scope.ts); the
|
|
5
|
-
// agents' API answers with all of it (server/
|
|
5
|
+
// agents' API answers with all of it (server/agentread.ts, `context`); shared/context.ts writes it as
|
|
6
6
|
// the block of Lean shown above a declaration's source and recorded with what an opinion judged.
|
|
7
7
|
// This is the text, read without elaborating it: where Lean is running, what Lean says wins.
|
|
8
8
|
/** The namespaces that exist in the graph: every proper prefix of a declaration's name. */
|