@agent-wiki/mcp 0.22.4 → 0.22.6
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 +31 -0
- package/dist/cli.js +177 -0
- package/dist/cli.js.map +1 -1
- package/dist/evidence-migration.js +1 -1
- package/dist/evidence-migration.js.map +1 -1
- package/dist/evidence-report.d.ts +17 -0
- package/dist/evidence-report.d.ts.map +1 -1
- package/dist/evidence-report.js +46 -2
- package/dist/evidence-report.js.map +1 -1
- package/dist/evidence-search.d.ts +71 -0
- package/dist/evidence-search.d.ts.map +1 -1
- package/dist/evidence-search.js +104 -1
- package/dist/evidence-search.js.map +1 -1
- package/dist/evidence-search.test.js +58 -1
- package/dist/evidence-search.test.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/okf-compat.d.ts +152 -0
- package/dist/okf-compat.d.ts.map +1 -0
- package/dist/okf-compat.js +604 -0
- package/dist/okf-compat.js.map +1 -0
- package/dist/okf-compat.test.d.ts +2 -0
- package/dist/okf-compat.test.d.ts.map +1 -0
- package/dist/okf-compat.test.js +234 -0
- package/dist/okf-compat.test.js.map +1 -0
- package/dist/okf-export.d.ts +63 -0
- package/dist/okf-export.d.ts.map +1 -0
- package/dist/okf-export.js +655 -0
- package/dist/okf-export.js.map +1 -0
- package/dist/okf-export.test.d.ts +2 -0
- package/dist/okf-export.test.d.ts.map +1 -0
- package/dist/okf-export.test.js +469 -0
- package/dist/okf-export.test.js.map +1 -0
- package/dist/okf-import.d.ts +136 -0
- package/dist/okf-import.d.ts.map +1 -0
- package/dist/okf-import.js +471 -0
- package/dist/okf-import.js.map +1 -0
- package/dist/okf-import.test.d.ts +2 -0
- package/dist/okf-import.test.d.ts.map +1 -0
- package/dist/okf-import.test.js +339 -0
- package/dist/okf-import.test.js.map +1 -0
- package/dist/okf-trust.test.d.ts +2 -0
- package/dist/okf-trust.test.d.ts.map +1 -0
- package/dist/okf-trust.test.js +223 -0
- package/dist/okf-trust.test.js.map +1 -0
- package/dist/okf.d.ts +128 -0
- package/dist/okf.d.ts.map +1 -0
- package/dist/okf.js +659 -0
- package/dist/okf.js.map +1 -0
- package/dist/search-currency.d.ts +44 -0
- package/dist/search-currency.d.ts.map +1 -0
- package/dist/search-currency.js +111 -0
- package/dist/search-currency.js.map +1 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +617 -21
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +772 -0
- package/dist/server.test.js.map +1 -1
- package/dist/wiki-graph.d.ts +126 -0
- package/dist/wiki-graph.d.ts.map +1 -0
- package/dist/wiki-graph.js +479 -0
- package/dist/wiki-graph.js.map +1 -0
- package/dist/wiki-graph.test.d.ts +2 -0
- package/dist/wiki-graph.test.d.ts.map +1 -0
- package/dist/wiki-graph.test.js +216 -0
- package/dist/wiki-graph.test.js.map +1 -0
- package/dist/wiki.d.ts +140 -1
- package/dist/wiki.d.ts.map +1 -1
- package/dist/wiki.js +509 -23
- package/dist/wiki.js.map +1 -1
- package/dist/worklist.d.ts +43 -0
- package/dist/worklist.d.ts.map +1 -0
- package/dist/worklist.js +147 -0
- package/dist/worklist.js.map +1 -0
- package/dist/worklist.test.d.ts +2 -0
- package/dist/worklist.test.d.ts.map +1 -0
- package/dist/worklist.test.js +233 -0
- package/dist/worklist.test.js.map +1 -0
- package/docs/evidence-envelope.md +5 -0
- package/docs/okf-adoption-plan.md +566 -0
- package/docs/okf-compat-plan.md +418 -0
- package/docs/okf-extensions.md +245 -0
- package/docs/open-knowledge-format.md +280 -0
- package/docs/tools.md +264 -2
- package/package.json +1 -1
- package/schemas/agent-wiki-okf.schema.json +130 -0
- package/skills/agent-wiki/SKILL.md +7 -0
- package/skills/agent-wiki/references/tools-reference.md +80 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiki-level link graph for agents: the `[[wikilink]]` structure between pages, with
|
|
3
|
+
* backlinks, neighbourhoods, orphans, broken links and shortest paths.
|
|
4
|
+
*
|
|
5
|
+
* `computeWikiGraph` is pure (no I/O) and follows the link-resolution order of
|
|
6
|
+
* `graph-viewer/src/graph.ts` (exact slug, then a unique basename), so the viewer and the
|
|
7
|
+
* `wiki_graph` tool agree on which page a link points to. The viewer stays a standalone
|
|
8
|
+
* package and keeps its own copy; this module is what core and the MCP surface use.
|
|
9
|
+
*
|
|
10
|
+
* Every query returns its result together with an EvidenceEnvelope:
|
|
11
|
+
* - a direct `[[link]]` edge → strong / deterministic
|
|
12
|
+
* - a path or neighbourhood over 2+ hops → weak / inferred (linked pages need not be
|
|
13
|
+
* related in the way the chain suggests)
|
|
14
|
+
* - nothing found, or the depth cap hit → absent, abstain: true
|
|
15
|
+
*/
|
|
16
|
+
import type { EvidenceEnvelope } from "./evidence.js";
|
|
17
|
+
/** What the graph needs from a page. `WikiPage` satisfies this. */
|
|
18
|
+
export interface WikiGraphPage {
|
|
19
|
+
/** Relative to wiki/, forward or back slashes, with `.md`. */
|
|
20
|
+
path: string;
|
|
21
|
+
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* `[[wikilink]]` targets as written, without the `|alias` part, and Markdown links as a
|
|
24
|
+
* path from the wiki root with a leading `/` (see `scanLinks` in okf-compat.ts).
|
|
25
|
+
*/
|
|
26
|
+
links: string[];
|
|
27
|
+
/** Page body, used only for the snippet around each link. */
|
|
28
|
+
content: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WikiGraphEdge {
|
|
31
|
+
/** Slug of the page that contains the link. */
|
|
32
|
+
from: string;
|
|
33
|
+
/** Slug of the page the link resolves to. */
|
|
34
|
+
to: string;
|
|
35
|
+
/** The link target as written in the source page. */
|
|
36
|
+
target: string;
|
|
37
|
+
/** The line of the source page that contains the link, trimmed. */
|
|
38
|
+
snippet: string;
|
|
39
|
+
}
|
|
40
|
+
export interface WikiGraphDanglingLink {
|
|
41
|
+
/** Slug of the page that contains the link. */
|
|
42
|
+
from: string;
|
|
43
|
+
/** The link target as written. */
|
|
44
|
+
target: string;
|
|
45
|
+
snippet: string;
|
|
46
|
+
}
|
|
47
|
+
export interface WikiGraphAmbiguousLink extends WikiGraphDanglingLink {
|
|
48
|
+
/** Slugs that share the basename the link names. */
|
|
49
|
+
candidates: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface WikiGraphNode {
|
|
52
|
+
slug: string;
|
|
53
|
+
path: string;
|
|
54
|
+
title: string;
|
|
55
|
+
system: boolean;
|
|
56
|
+
inDegree: number;
|
|
57
|
+
outDegree: number;
|
|
58
|
+
}
|
|
59
|
+
export interface WikiGraph {
|
|
60
|
+
nodes: Map<string, WikiGraphNode>;
|
|
61
|
+
/** Outgoing resolved edges per slug, one per distinct target page. */
|
|
62
|
+
out: Map<string, WikiGraphEdge[]>;
|
|
63
|
+
/** Incoming resolved edges per slug, one per distinct source page. */
|
|
64
|
+
in: Map<string, WikiGraphEdge[]>;
|
|
65
|
+
/** Links whose target is no page. */
|
|
66
|
+
broken: WikiGraphDanglingLink[];
|
|
67
|
+
/** Links by bare name to a basename that several pages share. */
|
|
68
|
+
ambiguous: WikiGraphAmbiguousLink[];
|
|
69
|
+
basenameIndex: Map<string, string[]>;
|
|
70
|
+
}
|
|
71
|
+
export declare const WIKI_GRAPH_DEFAULT_DEPTH = 1;
|
|
72
|
+
export declare const WIKI_GRAPH_MAX_NEIGHBOR_DEPTH = 3;
|
|
73
|
+
export declare const WIKI_GRAPH_DEFAULT_PATH_DEPTH = 6;
|
|
74
|
+
export declare const WIKI_GRAPH_MAX_PATH_DEPTH = 10;
|
|
75
|
+
export declare const WIKI_GRAPH_DEFAULT_LIMIT = 100;
|
|
76
|
+
export declare const WIKI_GRAPH_MAX_LIMIT = 500;
|
|
77
|
+
/**
|
|
78
|
+
* Build the link graph. Pure. `isSystem` marks pages such as index.md and log.md, which
|
|
79
|
+
* link to almost everything and are left out of traversals unless asked for.
|
|
80
|
+
*/
|
|
81
|
+
export declare function computeWikiGraph(pages: WikiGraphPage[], isSystem?: (pagePath: string) => boolean): WikiGraph;
|
|
82
|
+
/** Resolve what a caller typed (`foo`, `foo.md`, `topic/foo`) to a page slug. */
|
|
83
|
+
export declare function resolvePageRef(graph: WikiGraph, ref: string): {
|
|
84
|
+
slug: string;
|
|
85
|
+
} | {
|
|
86
|
+
error: string;
|
|
87
|
+
candidates?: string[];
|
|
88
|
+
};
|
|
89
|
+
export interface WikiGraphQueryResult {
|
|
90
|
+
query_type: string;
|
|
91
|
+
evidence: EvidenceEnvelope;
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
}
|
|
94
|
+
/** Pages that link to `page`, each with the line the link sits on. */
|
|
95
|
+
export declare function queryBacklinks(graph: WikiGraph, page: string, opts?: {
|
|
96
|
+
limit?: number;
|
|
97
|
+
}): WikiGraphQueryResult;
|
|
98
|
+
/** Pages within `depth` hops of `page`, following links in both directions. */
|
|
99
|
+
export declare function queryNeighbors(graph: WikiGraph, page: string, opts?: {
|
|
100
|
+
depth?: number;
|
|
101
|
+
includeSystem?: boolean;
|
|
102
|
+
limit?: number;
|
|
103
|
+
}): WikiGraphQueryResult;
|
|
104
|
+
/** Pages that no other page links to. System pages are not reported, but their links count. */
|
|
105
|
+
export declare function queryOrphans(graph: WikiGraph, opts?: {
|
|
106
|
+
limit?: number;
|
|
107
|
+
}): WikiGraphQueryResult;
|
|
108
|
+
/** `[[links]]` whose target is no page, and bare links whose name several pages share. */
|
|
109
|
+
export declare function queryBrokenLinks(graph: WikiGraph, opts?: {
|
|
110
|
+
limit?: number;
|
|
111
|
+
}): WikiGraphQueryResult;
|
|
112
|
+
/**
|
|
113
|
+
* Shortest chain of links between two pages, by breadth-first search with a hard depth cap.
|
|
114
|
+
* `directed: false` (the default) follows links both ways; `directed: true` only from a page
|
|
115
|
+
* to the pages it links to.
|
|
116
|
+
*/
|
|
117
|
+
export declare function queryShortestPath(graph: WikiGraph, from: string, to: string, opts?: {
|
|
118
|
+
maxDepth?: number;
|
|
119
|
+
directed?: boolean;
|
|
120
|
+
includeSystem?: boolean;
|
|
121
|
+
}): WikiGraphQueryResult;
|
|
122
|
+
export declare const WIKI_GRAPH_QUERY_TYPES: readonly ["backlinks", "neighbors", "orphans", "broken_links", "shortest_path"];
|
|
123
|
+
export type WikiGraphQueryType = (typeof WIKI_GRAPH_QUERY_TYPES)[number];
|
|
124
|
+
/** Dispatch a `wiki_graph` call. Throws on a bad `query_type` or a missing argument. */
|
|
125
|
+
export declare function runWikiGraphQuery(graph: WikiGraph, args: Record<string, unknown>): WikiGraphQueryResult;
|
|
126
|
+
//# sourceMappingURL=wiki-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiki-graph.d.ts","sourceRoot":"","sources":["../src/wiki-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AAI1E,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO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eAAO,MAAM,sBAAsB,iFAAkF,CAAC;AACtH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CA+BvG"}
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiki-level link graph for agents: the `[[wikilink]]` structure between pages, with
|
|
3
|
+
* backlinks, neighbourhoods, orphans, broken links and shortest paths.
|
|
4
|
+
*
|
|
5
|
+
* `computeWikiGraph` is pure (no I/O) and follows the link-resolution order of
|
|
6
|
+
* `graph-viewer/src/graph.ts` (exact slug, then a unique basename), so the viewer and the
|
|
7
|
+
* `wiki_graph` tool agree on which page a link points to. The viewer stays a standalone
|
|
8
|
+
* package and keeps its own copy; this module is what core and the MCP surface use.
|
|
9
|
+
*
|
|
10
|
+
* Every query returns its result together with an EvidenceEnvelope:
|
|
11
|
+
* - a direct `[[link]]` edge → strong / deterministic
|
|
12
|
+
* - a path or neighbourhood over 2+ hops → weak / inferred (linked pages need not be
|
|
13
|
+
* related in the way the chain suggests)
|
|
14
|
+
* - nothing found, or the depth cap hit → absent, abstain: true
|
|
15
|
+
*/
|
|
16
|
+
import { absentDeterministic, strongDeterministic } from "./evidence.js";
|
|
17
|
+
import { isExactLink, scanLinks } from "./okf-compat.js";
|
|
18
|
+
export const WIKI_GRAPH_DEFAULT_DEPTH = 1;
|
|
19
|
+
export const WIKI_GRAPH_MAX_NEIGHBOR_DEPTH = 3;
|
|
20
|
+
export const WIKI_GRAPH_DEFAULT_PATH_DEPTH = 6;
|
|
21
|
+
export const WIKI_GRAPH_MAX_PATH_DEPTH = 10;
|
|
22
|
+
export const WIKI_GRAPH_DEFAULT_LIMIT = 100;
|
|
23
|
+
export const WIKI_GRAPH_MAX_LIMIT = 500;
|
|
24
|
+
const SNIPPET_MAX = 200;
|
|
25
|
+
function toSlug(pagePath) {
|
|
26
|
+
const normalized = pagePath.replace(/\\/g, "/");
|
|
27
|
+
return normalized.endsWith(".md") ? normalized.slice(0, -3) : normalized;
|
|
28
|
+
}
|
|
29
|
+
function baseOf(slug) {
|
|
30
|
+
return slug.includes("/") ? slug.slice(slug.lastIndexOf("/") + 1) : slug;
|
|
31
|
+
}
|
|
32
|
+
const SNIPPET_LINK_RE = /\[\[([^\]]+)\]\]/g;
|
|
33
|
+
/**
|
|
34
|
+
* For every link target in `content`, the first line it appears on, trimmed and capped.
|
|
35
|
+
* One pass over the body, so a page with thousands of links (the generated index) costs
|
|
36
|
+
* its length once instead of once per link.
|
|
37
|
+
*/
|
|
38
|
+
function snippetsByTarget(content) {
|
|
39
|
+
const byTarget = new Map();
|
|
40
|
+
for (const line of content.split("\n")) {
|
|
41
|
+
if (!line.includes("[["))
|
|
42
|
+
continue;
|
|
43
|
+
let snippet;
|
|
44
|
+
for (const m of line.matchAll(SNIPPET_LINK_RE)) {
|
|
45
|
+
const target = m[1].split("|")[0].trim();
|
|
46
|
+
if (!target || byTarget.has(target))
|
|
47
|
+
continue;
|
|
48
|
+
if (snippet === undefined) {
|
|
49
|
+
const trimmed = line.trim();
|
|
50
|
+
snippet = trimmed.length > SNIPPET_MAX ? trimmed.slice(0, SNIPPET_MAX - 1) + "…" : trimmed;
|
|
51
|
+
}
|
|
52
|
+
byTarget.set(target, snippet);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return byTarget;
|
|
56
|
+
}
|
|
57
|
+
function resolveTarget(target, nodes, basenameIndex) {
|
|
58
|
+
const trimmed = target.trim();
|
|
59
|
+
if (isExactLink(trimmed)) {
|
|
60
|
+
// A Markdown link, already resolved to a path from the wiki root: that file or nothing.
|
|
61
|
+
const exact = toSlug(trimmed.slice(1));
|
|
62
|
+
return nodes.has(exact) ? { kind: "page", slug: exact } : { kind: "none" };
|
|
63
|
+
}
|
|
64
|
+
const bare = toSlug(trimmed);
|
|
65
|
+
if (nodes.has(bare))
|
|
66
|
+
return { kind: "page", slug: bare };
|
|
67
|
+
const candidates = basenameIndex.get(bare);
|
|
68
|
+
if (candidates && candidates.length === 1)
|
|
69
|
+
return { kind: "page", slug: candidates[0] };
|
|
70
|
+
if (candidates && candidates.length > 1)
|
|
71
|
+
return { kind: "ambiguous", candidates: [...candidates] };
|
|
72
|
+
return { kind: "none" };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build the link graph. Pure. `isSystem` marks pages such as index.md and log.md, which
|
|
76
|
+
* link to almost everything and are left out of traversals unless asked for.
|
|
77
|
+
*/
|
|
78
|
+
export function computeWikiGraph(pages, isSystem = () => false) {
|
|
79
|
+
const nodes = new Map();
|
|
80
|
+
const basenameIndex = new Map();
|
|
81
|
+
for (const p of pages) {
|
|
82
|
+
const slug = toSlug(p.path);
|
|
83
|
+
nodes.set(slug, {
|
|
84
|
+
slug,
|
|
85
|
+
path: slug + ".md",
|
|
86
|
+
title: p.title,
|
|
87
|
+
system: isSystem(slug + ".md"),
|
|
88
|
+
inDegree: 0,
|
|
89
|
+
outDegree: 0,
|
|
90
|
+
});
|
|
91
|
+
const base = baseOf(slug);
|
|
92
|
+
const list = basenameIndex.get(base);
|
|
93
|
+
if (list)
|
|
94
|
+
list.push(slug);
|
|
95
|
+
else
|
|
96
|
+
basenameIndex.set(base, [slug]);
|
|
97
|
+
}
|
|
98
|
+
for (const list of basenameIndex.values())
|
|
99
|
+
list.sort();
|
|
100
|
+
const out = new Map();
|
|
101
|
+
const incoming = new Map();
|
|
102
|
+
const broken = [];
|
|
103
|
+
const ambiguous = [];
|
|
104
|
+
for (const p of pages) {
|
|
105
|
+
const from = toSlug(p.path);
|
|
106
|
+
const seenTargets = new Set();
|
|
107
|
+
const seenPages = new Set();
|
|
108
|
+
const snippets = snippetsByTarget(p.content);
|
|
109
|
+
if (p.links.some(isExactLink)) {
|
|
110
|
+
// Markdown links: find the line each one sits on.
|
|
111
|
+
const lines = p.content.split("\n");
|
|
112
|
+
for (const occ of scanLinks(p.content, p.path)) {
|
|
113
|
+
if (!isExactLink(occ.link) || snippets.has(occ.link))
|
|
114
|
+
continue;
|
|
115
|
+
const text = (lines[occ.line] ?? "").trim();
|
|
116
|
+
snippets.set(occ.link, text.length > SNIPPET_MAX ? text.slice(0, SNIPPET_MAX - 1) + "…" : text);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const snippetFor = (target) => snippets.get(target) ?? "";
|
|
120
|
+
for (const rawTarget of p.links) {
|
|
121
|
+
const target = rawTarget.trim();
|
|
122
|
+
if (!target || seenTargets.has(target))
|
|
123
|
+
continue;
|
|
124
|
+
seenTargets.add(target);
|
|
125
|
+
const resolved = resolveTarget(target, nodes, basenameIndex);
|
|
126
|
+
if (resolved.kind === "none") {
|
|
127
|
+
broken.push({ from, target, snippet: snippetFor(target) });
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (resolved.kind === "ambiguous") {
|
|
131
|
+
ambiguous.push({
|
|
132
|
+
from,
|
|
133
|
+
target,
|
|
134
|
+
snippet: snippetFor(target),
|
|
135
|
+
candidates: resolved.candidates,
|
|
136
|
+
});
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const to = resolved.slug;
|
|
140
|
+
if (to === from || seenPages.has(to))
|
|
141
|
+
continue; // self-links and repeats add nothing
|
|
142
|
+
seenPages.add(to);
|
|
143
|
+
const edge = { from, to, target, snippet: snippetFor(target) };
|
|
144
|
+
const o = out.get(from);
|
|
145
|
+
if (o)
|
|
146
|
+
o.push(edge);
|
|
147
|
+
else
|
|
148
|
+
out.set(from, [edge]);
|
|
149
|
+
const i = incoming.get(to);
|
|
150
|
+
if (i)
|
|
151
|
+
i.push(edge);
|
|
152
|
+
else
|
|
153
|
+
incoming.set(to, [edge]);
|
|
154
|
+
nodes.get(from).outDegree++;
|
|
155
|
+
nodes.get(to).inDegree++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return { nodes, out, in: incoming, broken, ambiguous, basenameIndex };
|
|
159
|
+
}
|
|
160
|
+
/** Resolve what a caller typed (`foo`, `foo.md`, `topic/foo`) to a page slug. */
|
|
161
|
+
export function resolvePageRef(graph, ref) {
|
|
162
|
+
const resolved = resolveTarget(ref, graph.nodes, graph.basenameIndex);
|
|
163
|
+
if (resolved.kind === "page")
|
|
164
|
+
return { slug: resolved.slug };
|
|
165
|
+
if (resolved.kind === "ambiguous") {
|
|
166
|
+
return {
|
|
167
|
+
error: `"${ref}" names more than one page; use the full path`,
|
|
168
|
+
candidates: resolved.candidates,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return { error: `no wiki page matches "${ref}"` };
|
|
172
|
+
}
|
|
173
|
+
function clampInt(value, fallback, min, max) {
|
|
174
|
+
const n = typeof value === "number" && Number.isFinite(value) ? Math.floor(value) : fallback;
|
|
175
|
+
return Math.min(Math.max(n, min), max);
|
|
176
|
+
}
|
|
177
|
+
function pageRef(graph, slug) {
|
|
178
|
+
const node = graph.nodes.get(slug);
|
|
179
|
+
return { page: node.path, title: node.title, ...(node.system ? { system: true } : {}) };
|
|
180
|
+
}
|
|
181
|
+
function prov(graph, slugs, max = 20) {
|
|
182
|
+
const outList = [];
|
|
183
|
+
for (const slug of slugs) {
|
|
184
|
+
const node = graph.nodes.get(slug);
|
|
185
|
+
if (!node)
|
|
186
|
+
continue;
|
|
187
|
+
outList.push({ wikiPage: node.path });
|
|
188
|
+
if (outList.length >= max)
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
return outList;
|
|
192
|
+
}
|
|
193
|
+
function weakInferred(rationale, provenance) {
|
|
194
|
+
return { confidence: "weak", basis: "inferred", abstain: false, rationale, provenance };
|
|
195
|
+
}
|
|
196
|
+
function absentUnsupported(rationale, provenance = []) {
|
|
197
|
+
return { confidence: "absent", basis: "unsupported", abstain: true, rationale, provenance };
|
|
198
|
+
}
|
|
199
|
+
function unknownPage(queryType, ref, r) {
|
|
200
|
+
return {
|
|
201
|
+
query_type: queryType,
|
|
202
|
+
page: ref,
|
|
203
|
+
error: r.error,
|
|
204
|
+
...(r.candidates ? { candidates: r.candidates.map((c) => c + ".md") } : {}),
|
|
205
|
+
evidence: absentUnsupported(r.error),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/** Pages that link to `page`, each with the line the link sits on. */
|
|
209
|
+
export function queryBacklinks(graph, page, opts = {}) {
|
|
210
|
+
const r = resolvePageRef(graph, page);
|
|
211
|
+
if ("error" in r)
|
|
212
|
+
return unknownPage("backlinks", page, r);
|
|
213
|
+
const limit = clampInt(opts.limit, WIKI_GRAPH_DEFAULT_LIMIT, 1, WIKI_GRAPH_MAX_LIMIT);
|
|
214
|
+
const edges = [...(graph.in.get(r.slug) ?? [])].sort((a, b) => a.from.localeCompare(b.from));
|
|
215
|
+
const backlinks = edges.slice(0, limit).map((e) => ({
|
|
216
|
+
...pageRef(graph, e.from),
|
|
217
|
+
link: e.target,
|
|
218
|
+
snippet: e.snippet,
|
|
219
|
+
}));
|
|
220
|
+
const target = graph.nodes.get(r.slug);
|
|
221
|
+
const evidence = edges.length === 0
|
|
222
|
+
? absentDeterministic(`No page links to ${target.path}.`, [{ wikiPage: target.path }])
|
|
223
|
+
: strongDeterministic(`${edges.length} page(s) contain a [[link]] that resolves to ${target.path}.`, prov(graph, edges.map((e) => e.from)));
|
|
224
|
+
return {
|
|
225
|
+
query_type: "backlinks",
|
|
226
|
+
page: target.path,
|
|
227
|
+
count: edges.length,
|
|
228
|
+
backlinks,
|
|
229
|
+
truncated: edges.length > backlinks.length,
|
|
230
|
+
evidence,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** Pages within `depth` hops of `page`, following links in both directions. */
|
|
234
|
+
export function queryNeighbors(graph, page, opts = {}) {
|
|
235
|
+
const r = resolvePageRef(graph, page);
|
|
236
|
+
if ("error" in r)
|
|
237
|
+
return unknownPage("neighbors", page, r);
|
|
238
|
+
const depth = clampInt(opts.depth, WIKI_GRAPH_DEFAULT_DEPTH, 1, WIKI_GRAPH_MAX_NEIGHBOR_DEPTH);
|
|
239
|
+
const limit = clampInt(opts.limit, WIKI_GRAPH_DEFAULT_LIMIT, 1, WIKI_GRAPH_MAX_LIMIT);
|
|
240
|
+
const includeSystem = opts.includeSystem === true;
|
|
241
|
+
const usable = (slug) => includeSystem || !graph.nodes.get(slug).system;
|
|
242
|
+
const found = new Map();
|
|
243
|
+
let frontier = [r.slug];
|
|
244
|
+
const visited = new Set([r.slug]);
|
|
245
|
+
for (let hop = 1; hop <= depth && frontier.length > 0; hop++) {
|
|
246
|
+
const next = [];
|
|
247
|
+
for (const current of frontier) {
|
|
248
|
+
const steps = [
|
|
249
|
+
...(graph.out.get(current) ?? []).map((e) => [e.to, "outgoing"]),
|
|
250
|
+
...(graph.in.get(current) ?? []).map((e) => [e.from, "incoming"]),
|
|
251
|
+
];
|
|
252
|
+
for (const [slug, direction] of steps) {
|
|
253
|
+
if (visited.has(slug) || !usable(slug))
|
|
254
|
+
continue;
|
|
255
|
+
visited.add(slug);
|
|
256
|
+
found.set(slug, { slug, hops: hop, via: current, direction });
|
|
257
|
+
next.push(slug);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
frontier = next;
|
|
261
|
+
}
|
|
262
|
+
const all = [...found.values()].sort((a, b) => a.hops - b.hops || a.slug.localeCompare(b.slug));
|
|
263
|
+
const neighbors = all.slice(0, limit).map((f) => ({
|
|
264
|
+
...pageRef(graph, f.slug),
|
|
265
|
+
hops: f.hops,
|
|
266
|
+
// The direction of the last link on the way here: "outgoing" means the previous page
|
|
267
|
+
// links to this one, "incoming" means this one links to the previous page.
|
|
268
|
+
direction: f.direction,
|
|
269
|
+
via: graph.nodes.get(f.via).path,
|
|
270
|
+
}));
|
|
271
|
+
const start = graph.nodes.get(r.slug);
|
|
272
|
+
const direct = all.filter((f) => f.hops === 1).length;
|
|
273
|
+
let evidence;
|
|
274
|
+
if (all.length === 0) {
|
|
275
|
+
evidence = absentDeterministic(`${start.path} has no linked pages within ${depth} hop(s)` +
|
|
276
|
+
(includeSystem ? "." : " (system pages such as index.md are left out)."), [{ wikiPage: start.path }]);
|
|
277
|
+
}
|
|
278
|
+
else if (all.length === direct) {
|
|
279
|
+
evidence = strongDeterministic(`${direct} page(s) share a direct [[link]] with ${start.path}.`, prov(graph, all.map((f) => f.slug)));
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
evidence = weakInferred(`${direct} page(s) share a direct [[link]] with ${start.path}; ${all.length - direct} more are ` +
|
|
283
|
+
`2 or more hops away, where a chain of links does not show that the pages are related.`, prov(graph, all.map((f) => f.slug)));
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
query_type: "neighbors",
|
|
287
|
+
page: start.path,
|
|
288
|
+
depth,
|
|
289
|
+
count: all.length,
|
|
290
|
+
neighbors,
|
|
291
|
+
truncated: all.length > neighbors.length,
|
|
292
|
+
evidence,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
/** Pages that no other page links to. System pages are not reported, but their links count. */
|
|
296
|
+
export function queryOrphans(graph, opts = {}) {
|
|
297
|
+
const limit = clampInt(opts.limit, WIKI_GRAPH_DEFAULT_LIMIT, 1, WIKI_GRAPH_MAX_LIMIT);
|
|
298
|
+
const all = [...graph.nodes.values()]
|
|
299
|
+
.filter((n) => !n.system && n.inDegree === 0)
|
|
300
|
+
.sort((a, b) => a.slug.localeCompare(b.slug));
|
|
301
|
+
const orphans = all.slice(0, limit).map((n) => ({ page: n.path, title: n.title, outDegree: n.outDegree }));
|
|
302
|
+
const evidence = all.length === 0
|
|
303
|
+
? strongDeterministic(`Every page has at least one incoming [[link]] (${graph.nodes.size} pages checked).`)
|
|
304
|
+
: absentUnsupported(`${all.length} page(s) have no incoming [[link]]: nothing in the wiki points to them, so ` +
|
|
305
|
+
`the graph cannot say what they relate to.`, prov(graph, all.map((n) => n.slug)));
|
|
306
|
+
return {
|
|
307
|
+
query_type: "orphans",
|
|
308
|
+
count: all.length,
|
|
309
|
+
orphans,
|
|
310
|
+
truncated: all.length > orphans.length,
|
|
311
|
+
evidence,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/** `[[links]]` whose target is no page, and bare links whose name several pages share. */
|
|
315
|
+
export function queryBrokenLinks(graph, opts = {}) {
|
|
316
|
+
const limit = clampInt(opts.limit, WIKI_GRAPH_DEFAULT_LIMIT, 1, WIKI_GRAPH_MAX_LIMIT);
|
|
317
|
+
const byFrom = (a, b) => a.from.localeCompare(b.from) || a.target.localeCompare(b.target);
|
|
318
|
+
const broken = [...graph.broken].sort(byFrom);
|
|
319
|
+
const ambiguous = [...graph.ambiguous].sort(byFrom);
|
|
320
|
+
const evidence = broken.length === 0 && ambiguous.length === 0
|
|
321
|
+
? strongDeterministic(`Every [[link]] resolves to exactly one page (${graph.nodes.size} pages checked).`)
|
|
322
|
+
: absentUnsupported(`${broken.length} [[link]](s) point to no page` +
|
|
323
|
+
(ambiguous.length > 0 ? ` and ${ambiguous.length} name a page that is not unique` : "") +
|
|
324
|
+
`; what they refer to is not in the wiki.`, prov(graph, new Set([...broken, ...ambiguous].map((b) => b.from))));
|
|
325
|
+
return {
|
|
326
|
+
query_type: "broken_links",
|
|
327
|
+
count: broken.length,
|
|
328
|
+
broken_links: broken.slice(0, limit).map((b) => ({
|
|
329
|
+
page: graph.nodes.get(b.from).path,
|
|
330
|
+
link: b.target,
|
|
331
|
+
snippet: b.snippet,
|
|
332
|
+
})),
|
|
333
|
+
ambiguous_count: ambiguous.length,
|
|
334
|
+
ambiguous_links: ambiguous.slice(0, limit).map((a) => ({
|
|
335
|
+
page: graph.nodes.get(a.from).path,
|
|
336
|
+
link: a.target,
|
|
337
|
+
snippet: a.snippet,
|
|
338
|
+
candidates: a.candidates.map((c) => c + ".md"),
|
|
339
|
+
})),
|
|
340
|
+
truncated: broken.length > limit || ambiguous.length > limit,
|
|
341
|
+
evidence,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Shortest chain of links between two pages, by breadth-first search with a hard depth cap.
|
|
346
|
+
* `directed: false` (the default) follows links both ways; `directed: true` only from a page
|
|
347
|
+
* to the pages it links to.
|
|
348
|
+
*/
|
|
349
|
+
export function queryShortestPath(graph, from, to, opts = {}) {
|
|
350
|
+
const a = resolvePageRef(graph, from);
|
|
351
|
+
if ("error" in a)
|
|
352
|
+
return { ...unknownPage("shortest_path", from, a), from, to };
|
|
353
|
+
const b = resolvePageRef(graph, to);
|
|
354
|
+
if ("error" in b)
|
|
355
|
+
return { ...unknownPage("shortest_path", to, b), from, to };
|
|
356
|
+
const maxDepth = clampInt(opts.maxDepth, WIKI_GRAPH_DEFAULT_PATH_DEPTH, 1, WIKI_GRAPH_MAX_PATH_DEPTH);
|
|
357
|
+
const directed = opts.directed === true;
|
|
358
|
+
const includeSystem = opts.includeSystem === true;
|
|
359
|
+
const start = graph.nodes.get(a.slug);
|
|
360
|
+
const goal = graph.nodes.get(b.slug);
|
|
361
|
+
const base = { query_type: "shortest_path", from: start.path, to: goal.path, directed, max_depth: maxDepth };
|
|
362
|
+
if (a.slug === b.slug) {
|
|
363
|
+
return {
|
|
364
|
+
...base,
|
|
365
|
+
found: true,
|
|
366
|
+
hops: 0,
|
|
367
|
+
path: [pageRef(graph, a.slug)],
|
|
368
|
+
evidence: strongDeterministic(`${start.path} is both ends of the path.`, [{ wikiPage: start.path }]),
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
// The two ends are always usable; system pages in between only when asked for.
|
|
372
|
+
const usable = (slug) => includeSystem || slug === b.slug || !graph.nodes.get(slug).system;
|
|
373
|
+
const stepsFrom = (current) => [
|
|
374
|
+
...(graph.out.get(current) ?? []).map((e) => [e.to, e]),
|
|
375
|
+
...(directed ? [] : (graph.in.get(current) ?? []).map((e) => [e.from, e])),
|
|
376
|
+
];
|
|
377
|
+
const cameFrom = new Map();
|
|
378
|
+
const visited = new Set([a.slug]);
|
|
379
|
+
let frontier = [a.slug];
|
|
380
|
+
let reached = false;
|
|
381
|
+
for (let hop = 1; hop <= maxDepth && frontier.length > 0 && !reached; hop++) {
|
|
382
|
+
const next = [];
|
|
383
|
+
for (const current of frontier) {
|
|
384
|
+
const steps = stepsFrom(current);
|
|
385
|
+
steps.sort((x, y) => x[0].localeCompare(y[0])); // same graph, same path
|
|
386
|
+
for (const [slug, edge] of steps) {
|
|
387
|
+
if (visited.has(slug) || !usable(slug))
|
|
388
|
+
continue;
|
|
389
|
+
visited.add(slug);
|
|
390
|
+
cameFrom.set(slug, { prev: current, edge });
|
|
391
|
+
if (slug === b.slug) {
|
|
392
|
+
reached = true;
|
|
393
|
+
break;
|
|
394
|
+
}
|
|
395
|
+
next.push(slug);
|
|
396
|
+
}
|
|
397
|
+
if (reached)
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
frontier = next;
|
|
401
|
+
}
|
|
402
|
+
if (!reached) {
|
|
403
|
+
// The cap only cut the search short if the last pages reached still lead somewhere new.
|
|
404
|
+
// When they do not, everything reachable was searched and "no path" is certain.
|
|
405
|
+
const capHit = frontier.some((current) => stepsFrom(current).some(([slug]) => !visited.has(slug) && usable(slug)));
|
|
406
|
+
const rationale = capHit
|
|
407
|
+
? `No path from ${start.path} to ${goal.path} within ${maxDepth} hop(s); the search stopped at the ` +
|
|
408
|
+
`depth cap, so a longer path may exist.`
|
|
409
|
+
: `No chain of ${directed ? "outgoing " : ""}[[links]] connects ${start.path} and ${goal.path}` +
|
|
410
|
+
(includeSystem ? "." : " (system pages such as index.md are left out).");
|
|
411
|
+
return {
|
|
412
|
+
...base,
|
|
413
|
+
found: false,
|
|
414
|
+
depth_cap_reached: capHit,
|
|
415
|
+
evidence: capHit
|
|
416
|
+
? absentUnsupported(rationale, [{ wikiPage: start.path }, { wikiPage: goal.path }])
|
|
417
|
+
: absentDeterministic(rationale, [{ wikiPage: start.path }, { wikiPage: goal.path }]),
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
const slugs = [b.slug];
|
|
421
|
+
const edges = [];
|
|
422
|
+
for (let cur = b.slug; cur !== a.slug;) {
|
|
423
|
+
const step = cameFrom.get(cur);
|
|
424
|
+
edges.unshift(step.edge);
|
|
425
|
+
slugs.unshift(step.prev);
|
|
426
|
+
cur = step.prev;
|
|
427
|
+
}
|
|
428
|
+
const hops = edges.length;
|
|
429
|
+
const rationale = hops === 1
|
|
430
|
+
? `${graph.nodes.get(edges[0].from).path} links directly to ${graph.nodes.get(edges[0].to).path}.`
|
|
431
|
+
: `${hops} links connect the two pages. Each link is real, but a chain of links does not show ` +
|
|
432
|
+
`that the two ends are related.`;
|
|
433
|
+
return {
|
|
434
|
+
...base,
|
|
435
|
+
found: true,
|
|
436
|
+
hops,
|
|
437
|
+
path: slugs.map((s) => pageRef(graph, s)),
|
|
438
|
+
links: edges.map((e) => ({
|
|
439
|
+
from: graph.nodes.get(e.from).path,
|
|
440
|
+
to: graph.nodes.get(e.to).path,
|
|
441
|
+
link: e.target,
|
|
442
|
+
snippet: e.snippet,
|
|
443
|
+
})),
|
|
444
|
+
evidence: hops === 1 ? strongDeterministic(rationale, prov(graph, slugs)) : weakInferred(rationale, prov(graph, slugs)),
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
export const WIKI_GRAPH_QUERY_TYPES = ["backlinks", "neighbors", "orphans", "broken_links", "shortest_path"];
|
|
448
|
+
/** Dispatch a `wiki_graph` call. Throws on a bad `query_type` or a missing argument. */
|
|
449
|
+
export function runWikiGraphQuery(graph, args) {
|
|
450
|
+
const queryType = args.query_type;
|
|
451
|
+
const need = (name) => {
|
|
452
|
+
const v = args[name];
|
|
453
|
+
if (typeof v !== "string" || v.trim() === "") {
|
|
454
|
+
throw new Error(`wiki_graph ${queryType}: "${name}" is required`);
|
|
455
|
+
}
|
|
456
|
+
return v;
|
|
457
|
+
};
|
|
458
|
+
const limit = args.limit;
|
|
459
|
+
const includeSystem = args.include_system === true;
|
|
460
|
+
switch (queryType) {
|
|
461
|
+
case "backlinks":
|
|
462
|
+
return queryBacklinks(graph, need("page"), { limit });
|
|
463
|
+
case "neighbors":
|
|
464
|
+
return queryNeighbors(graph, need("page"), { depth: args.depth, includeSystem, limit });
|
|
465
|
+
case "orphans":
|
|
466
|
+
return queryOrphans(graph, { limit });
|
|
467
|
+
case "broken_links":
|
|
468
|
+
return queryBrokenLinks(graph, { limit });
|
|
469
|
+
case "shortest_path":
|
|
470
|
+
return queryShortestPath(graph, need("from"), need("to"), {
|
|
471
|
+
maxDepth: args.max_depth,
|
|
472
|
+
directed: args.directed === true,
|
|
473
|
+
includeSystem,
|
|
474
|
+
});
|
|
475
|
+
default:
|
|
476
|
+
throw new Error(`Unknown wiki_graph query_type: "${queryType}". Expected: ${WIKI_GRAPH_QUERY_TYPES.join(" | ")}`);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=wiki-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiki-graph.js","sourceRoot":"","sources":["../src/wiki-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA8DzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,SAAS,MAAM,CAAC,QAA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