@imenam/mcp-documentor 1.0.79 → 1.0.81
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/dist/src/core/github-code-api.d.ts +10 -0
- package/dist/src/core/github-code-api.js +19 -0
- package/dist/src/core/storage-engine.d.ts +15 -1
- package/dist/src/core/storage-engine.js +24 -10
- package/dist/src/index.js +7 -8
- package/dist/src/tools/check-freshness.js +7 -10
- package/dist/src/tools/git-diff-doc.js +31 -9
- package/dist/src/tools/list-docs.js +7 -9
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/gui/dist/assets/{arc-CsM5OJTM.js → arc-CdXRzMBT.js} +1 -1
- package/gui/dist/assets/{architectureDiagram-3BPJPVTR-BwIu1llT.js → architectureDiagram-3BPJPVTR-CGUnwe_I.js} +1 -1
- package/gui/dist/assets/{blockDiagram-GPEHLZMM-BVijVnPI.js → blockDiagram-GPEHLZMM-BCI5_vQE.js} +1 -1
- package/gui/dist/assets/{c4Diagram-AAUBKEIU-D-rcZUZu.js → c4Diagram-AAUBKEIU-Bm9a6HGg.js} +1 -1
- package/gui/dist/assets/channel-f0BgDIcS.js +1 -0
- package/gui/dist/assets/{chunk-2J33WTMH-ByfTGREe.js → chunk-2J33WTMH-c7xNwExL.js} +1 -1
- package/gui/dist/assets/{chunk-4BX2VUAB-B_5oCXyz.js → chunk-4BX2VUAB-CmcU4Q0o.js} +1 -1
- package/gui/dist/assets/{chunk-55IACEB6-Bc2Kq9HD.js → chunk-55IACEB6-K8rRjNKN.js} +1 -1
- package/gui/dist/assets/{chunk-727SXJPM-CVwmKEMQ.js → chunk-727SXJPM-DMPnL1bv.js} +1 -1
- package/gui/dist/assets/{chunk-AQP2D5EJ-BkMuEFxD.js → chunk-AQP2D5EJ-BeRIIft8.js} +1 -1
- package/gui/dist/assets/{chunk-FMBD7UC4-CU7EDl9I.js → chunk-FMBD7UC4-CN4It-fp.js} +1 -1
- package/gui/dist/assets/{chunk-ND2GUHAM-1b34Dtkn.js → chunk-ND2GUHAM-Dy-ZqPua.js} +1 -1
- package/gui/dist/assets/{chunk-QZHKN3VN-DnUfMecI.js → chunk-QZHKN3VN-CaV4seJw.js} +1 -1
- package/gui/dist/assets/classDiagram-4FO5ZUOK-tGvt4n1B.js +1 -0
- package/gui/dist/assets/classDiagram-v2-Q7XG4LA2-tGvt4n1B.js +1 -0
- package/gui/dist/assets/{cose-bilkent-S5V4N54A-D9OBrxKr.js → cose-bilkent-S5V4N54A-B1qt_j1Z.js} +1 -1
- package/gui/dist/assets/{dagre-BM42HDAG-zDqwL8xs.js → dagre-BM42HDAG-4x5JEBQG.js} +1 -1
- package/gui/dist/assets/{diagram-2AECGRRQ-ejbP8WIj.js → diagram-2AECGRRQ-Q7TvjRjv.js} +1 -1
- package/gui/dist/assets/{diagram-5GNKFQAL-Cv9WmtFO.js → diagram-5GNKFQAL-Dguj26bf.js} +1 -1
- package/gui/dist/assets/{diagram-KO2AKTUF-BI0ybJiN.js → diagram-KO2AKTUF-DBv6MoZF.js} +1 -1
- package/gui/dist/assets/{diagram-LMA3HP47-DlVGttLq.js → diagram-LMA3HP47-mfVXwL5q.js} +1 -1
- package/gui/dist/assets/{diagram-OG6HWLK6-DjoAH-Fq.js → diagram-OG6HWLK6-Bn3_yQWG.js} +1 -1
- package/gui/dist/assets/{erDiagram-TEJ5UH35-BVQHVGK4.js → erDiagram-TEJ5UH35-Bp4wnBw7.js} +1 -1
- package/gui/dist/assets/{flowDiagram-I6XJVG4X-oZP2Z-6T.js → flowDiagram-I6XJVG4X-CGk72E1Q.js} +1 -1
- package/gui/dist/assets/{ganttDiagram-6RSMTGT7-dy4QyEOP.js → ganttDiagram-6RSMTGT7-C1WQIgpu.js} +1 -1
- package/gui/dist/assets/{gitGraphDiagram-PVQCEYII-BxgLy7Ln.js → gitGraphDiagram-PVQCEYII-DSIs1ZqI.js} +1 -1
- package/gui/dist/assets/{index-Dtv0slFQ.js → index-T7ZLHNgs.js} +4 -4
- package/gui/dist/assets/{infoDiagram-5YYISTIA-DNOdinpR.js → infoDiagram-5YYISTIA-DzHdfk5Y.js} +1 -1
- package/gui/dist/assets/{ishikawaDiagram-YF4QCWOH-C4pQ434G.js → ishikawaDiagram-YF4QCWOH-DLxqTmDU.js} +1 -1
- package/gui/dist/assets/{journeyDiagram-JHISSGLW-CBrVYW94.js → journeyDiagram-JHISSGLW-DYUPmZnf.js} +1 -1
- package/gui/dist/assets/{kanban-definition-UN3LZRKU-Df-rgiY8.js → kanban-definition-UN3LZRKU-f6km2MDT.js} +1 -1
- package/gui/dist/assets/{linear-B_6fRXVt.js → linear-DHhAaAXH.js} +1 -1
- package/gui/dist/assets/{mindmap-definition-RKZ34NQL-CRAd_VDM.js → mindmap-definition-RKZ34NQL-nergVxV3.js} +1 -1
- package/gui/dist/assets/{pieDiagram-4H26LBE5-CJkmLrDI.js → pieDiagram-4H26LBE5-D4IJAdGz.js} +1 -1
- package/gui/dist/assets/{quadrantDiagram-W4KKPZXB-D-rDEcnF.js → quadrantDiagram-W4KKPZXB-B5yYdOsV.js} +1 -1
- package/gui/dist/assets/{requirementDiagram-4Y6WPE33-DE8MhSMe.js → requirementDiagram-4Y6WPE33-BrhJp07G.js} +1 -1
- package/gui/dist/assets/{sankeyDiagram-5OEKKPKP-BwlxtrUs.js → sankeyDiagram-5OEKKPKP-CUBA4e7F.js} +1 -1
- package/gui/dist/assets/{sequenceDiagram-3UESZ5HK-B4LjBzWg.js → sequenceDiagram-3UESZ5HK-DP0-rUie.js} +1 -1
- package/gui/dist/assets/{stateDiagram-AJRCARHV-Bv72afPK.js → stateDiagram-AJRCARHV-_BnVcpam.js} +1 -1
- package/gui/dist/assets/stateDiagram-v2-BHNVJYJU-B5Vwq56z.js +1 -0
- package/gui/dist/assets/{timeline-definition-PNZ67QCA-CBxgf8iW.js → timeline-definition-PNZ67QCA-crbYjsrq.js} +1 -1
- package/gui/dist/assets/{vennDiagram-CIIHVFJN-DPSdK06q.js → vennDiagram-CIIHVFJN-EOqENtE1.js} +1 -1
- package/gui/dist/assets/{wardley-L42UT6IY-JIAzuoPm.js → wardley-L42UT6IY-B1FVq-_Y.js} +1 -1
- package/gui/dist/assets/{wardleyDiagram-YWT4CUSO-YDfaF1wT.js → wardleyDiagram-YWT4CUSO-D1DZwIH_.js} +1 -1
- package/gui/dist/assets/{xychartDiagram-2RQKCTM6-DHlPryZX.js → xychartDiagram-2RQKCTM6-B6Wr8_OJ.js} +1 -1
- package/gui/dist/index.html +1 -1
- package/package.json +1 -1
- package/gui/dist/assets/channel-DKPwwuQf.js +0 -1
- package/gui/dist/assets/classDiagram-4FO5ZUOK-CnCvVGW9.js +0 -1
- package/gui/dist/assets/classDiagram-v2-Q7XG4LA2-CnCvVGW9.js +0 -1
- package/gui/dist/assets/stateDiagram-v2-BHNVJYJU-BKJDOkkR.js +0 -1
|
@@ -40,6 +40,7 @@ export declare class GitHubCodeApi {
|
|
|
40
40
|
private readonly spec;
|
|
41
41
|
private readonly token;
|
|
42
42
|
private readonly treeByCommit;
|
|
43
|
+
private readonly commitByDate;
|
|
43
44
|
private readonly truncatedCommits;
|
|
44
45
|
private readonly blobCache;
|
|
45
46
|
constructor(spec: RepoSpec, token: string | undefined);
|
|
@@ -52,6 +53,15 @@ export declare class GitHubCodeApi {
|
|
|
52
53
|
* once within it, however many files that operation ends up reading.
|
|
53
54
|
*/
|
|
54
55
|
resolveRef(): Promise<ResolvedRef>;
|
|
56
|
+
/**
|
|
57
|
+
* The newest commit on the configured ref at or before `isoDate`, or undefined if the branch
|
|
58
|
+
* has no commit that old.
|
|
59
|
+
*
|
|
60
|
+
* This is how a snapshot taken before commits were recorded still gets a diff base: the date it
|
|
61
|
+
* was taken at stands in for the revision it was taken from. History is immutable below the ref's
|
|
62
|
+
* head, so the answer is cached for the life of the process.
|
|
63
|
+
*/
|
|
64
|
+
resolveCommitAtDate(isoDate: string): Promise<string | undefined>;
|
|
55
65
|
/** path → blob sha for every file in the commit's tree. A commit's tree never changes. */
|
|
56
66
|
getTree(commitSha: string): Promise<Map<string, string>>;
|
|
57
67
|
/**
|
|
@@ -58,6 +58,7 @@ export class GitHubCodeApi {
|
|
|
58
58
|
// at once, and they all need the same tree — and often the same blobs. Caching the promise makes
|
|
59
59
|
// concurrent callers await one request instead of each firing its own.
|
|
60
60
|
treeByCommit = new Map();
|
|
61
|
+
commitByDate = new Map();
|
|
61
62
|
truncatedCommits = new Set();
|
|
62
63
|
blobCache = new Map();
|
|
63
64
|
constructor(spec, token) {
|
|
@@ -116,6 +117,24 @@ export class GitHubCodeApi {
|
|
|
116
117
|
};
|
|
117
118
|
});
|
|
118
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* The newest commit on the configured ref at or before `isoDate`, or undefined if the branch
|
|
122
|
+
* has no commit that old.
|
|
123
|
+
*
|
|
124
|
+
* This is how a snapshot taken before commits were recorded still gets a diff base: the date it
|
|
125
|
+
* was taken at stands in for the revision it was taken from. History is immutable below the ref's
|
|
126
|
+
* head, so the answer is cached for the life of the process.
|
|
127
|
+
*/
|
|
128
|
+
resolveCommitAtDate(isoDate) {
|
|
129
|
+
return this.cached(this.commitByDate, isoDate, async () => {
|
|
130
|
+
const ref = this.spec.ref ?? "HEAD";
|
|
131
|
+
const commits = await this.request(`/repos/${this.spec.owner}/${this.spec.repo}/commits` +
|
|
132
|
+
`?sha=${encodeURIComponent(ref)}&until=${encodeURIComponent(isoDate)}&per_page=1`);
|
|
133
|
+
const sha = Array.isArray(commits) && typeof commits[0]?.sha === "string" ? commits[0].sha : undefined;
|
|
134
|
+
logger.debug(`${this.label}: commit at or before ${isoDate} is ${sha ? sha.slice(0, 7) : "none"}`);
|
|
135
|
+
return sha;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
119
138
|
/** path → blob sha for every file in the commit's tree. A commit's tree never changes. */
|
|
120
139
|
getTree(commitSha) {
|
|
121
140
|
return this.cached(this.treeByCommit, commitSha, async () => {
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type { DocEntry, DocSummary, ExportBundle } from "../../shared/schemas/doc.schema.js";
|
|
1
|
+
import type { DocEntry, DocSummary, TrackedFile, ExportBundle } from "../../shared/schemas/doc.schema.js";
|
|
2
2
|
import type { HistoryStore } from "./history-store.js";
|
|
3
3
|
interface GlobalConfig {
|
|
4
4
|
projects: string[];
|
|
5
5
|
foldersMigrated?: boolean;
|
|
6
6
|
}
|
|
7
|
+
/** One doc as a project listing yields it: the GUI-facing summary, plus what it tracks. */
|
|
8
|
+
export interface DocListing {
|
|
9
|
+
summary: DocSummary;
|
|
10
|
+
tracked_files: TrackedFile[];
|
|
11
|
+
}
|
|
7
12
|
/**
|
|
8
13
|
* GitHub sync settings. Sourced exclusively from environment variables — the
|
|
9
14
|
* repository, branch and token are administration concerns and must never be
|
|
@@ -43,6 +48,15 @@ export declare class StorageEngine {
|
|
|
43
48
|
saveDoc(doc: DocEntry, project: string, changeType?: "create" | "update" | "patch"): Promise<void>;
|
|
44
49
|
getDoc(id: string, project: string): Promise<DocEntry | null>;
|
|
45
50
|
listDocs(project: string): Promise<DocSummary[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Same listing, plus the tracked files parsed from the very same read.
|
|
53
|
+
*
|
|
54
|
+
* Freshness has to know what each doc tracks, and fetching that with `getDoc` per summary read
|
|
55
|
+
* and re-parsed every file of the project a second time. Callers that scan a whole project use
|
|
56
|
+
* this instead; `tracked_files` stays out of `DocSummary` so it is never shipped to the GUI,
|
|
57
|
+
* which only needs the stale/broken flags.
|
|
58
|
+
*/
|
|
59
|
+
listDocsDetailed(project: string): Promise<DocListing[]>;
|
|
46
60
|
deleteDoc(id: string, project: string): Promise<boolean>;
|
|
47
61
|
moveDoc(oldId: string, newId: string, project: string): Promise<boolean>;
|
|
48
62
|
getBundles(): ExportBundle[];
|
|
@@ -151,11 +151,22 @@ export class StorageEngine {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
async listDocs(project) {
|
|
154
|
+
return (await this.listDocsDetailed(project)).map((listing) => listing.summary);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Same listing, plus the tracked files parsed from the very same read.
|
|
158
|
+
*
|
|
159
|
+
* Freshness has to know what each doc tracks, and fetching that with `getDoc` per summary read
|
|
160
|
+
* and re-parsed every file of the project a second time. Callers that scan a whole project use
|
|
161
|
+
* this instead; `tracked_files` stays out of `DocSummary` so it is never shipped to the GUI,
|
|
162
|
+
* which only needs the stale/broken flags.
|
|
163
|
+
*/
|
|
164
|
+
async listDocsDetailed(project) {
|
|
154
165
|
const projectDir = this.getProjectDir(project);
|
|
155
166
|
if (!fs.existsSync(projectDir))
|
|
156
167
|
return [];
|
|
157
168
|
const files = this.walkMdFiles(projectDir);
|
|
158
|
-
const
|
|
169
|
+
const listings = [];
|
|
159
170
|
for (const filePath of files) {
|
|
160
171
|
try {
|
|
161
172
|
const raw = fs.readFileSync(filePath, "utf-8");
|
|
@@ -164,21 +175,24 @@ export class StorageEngine {
|
|
|
164
175
|
const relPath = path.relative(projectDir, filePath);
|
|
165
176
|
const id = relPath.replace(/\.md$/, "").split(path.sep).join("/");
|
|
166
177
|
const folder = id.includes("/") ? id.split("/").slice(0, -1).join("/") : undefined;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
listings.push({
|
|
179
|
+
summary: {
|
|
180
|
+
id,
|
|
181
|
+
title: data.title ?? "",
|
|
182
|
+
createdAt: stat.birthtime.toISOString(),
|
|
183
|
+
updatedAt: data.updatedAt ?? "",
|
|
184
|
+
tags: (data.tags ?? []),
|
|
185
|
+
folder,
|
|
186
|
+
isStale: false,
|
|
187
|
+
},
|
|
188
|
+
tracked_files: (data.tracked_files ?? []),
|
|
175
189
|
});
|
|
176
190
|
}
|
|
177
191
|
catch (err) {
|
|
178
192
|
logger.warn(`Failed to read doc ${filePath}: ${err}`);
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
|
-
return
|
|
195
|
+
return listings;
|
|
182
196
|
}
|
|
183
197
|
// resolveDoc() (first project whose tree contained the path) was removed on purpose:
|
|
184
198
|
// it silently sent reads and writes to the wrong project when the same doc path
|
package/dist/src/index.js
CHANGED
|
@@ -204,16 +204,15 @@ function requireProjectFromIPC(msg) {
|
|
|
204
204
|
}
|
|
205
205
|
/** Loads one project's summaries and flags each entry as stale/broken. */
|
|
206
206
|
async function listDocsWithFreshness(project) {
|
|
207
|
-
const
|
|
208
|
-
await mapWithConcurrency(
|
|
209
|
-
|
|
210
|
-
if (!full || full.tracked_files.length === 0)
|
|
207
|
+
const listings = await storageEngine.listDocsDetailed(project);
|
|
208
|
+
await mapWithConcurrency(listings, DOC_CONCURRENCY, async ({ summary, tracked_files }) => {
|
|
209
|
+
if (tracked_files.length === 0)
|
|
211
210
|
return;
|
|
212
|
-
const report = await computeFreshness(
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
const report = await computeFreshness(tracked_files, project);
|
|
212
|
+
summary.isStale = report.status === "stale" || report.status === "broken";
|
|
213
|
+
summary.isBroken = report.status === "broken";
|
|
215
214
|
});
|
|
216
|
-
return
|
|
215
|
+
return listings.map((listing) => listing.summary);
|
|
217
216
|
}
|
|
218
217
|
/**
|
|
219
218
|
* Tells every connected GUI that one project's docs changed. Clients showing
|
|
@@ -153,9 +153,9 @@ function renderUntrackedList(titles, heading) {
|
|
|
153
153
|
return `\n\n${heading}\n${shown.join("\n")}${suffix}`;
|
|
154
154
|
}
|
|
155
155
|
async function scanProjectFreshness(storageEngine, project) {
|
|
156
|
-
const
|
|
156
|
+
const listings = await storageEngine.listDocsDetailed(project);
|
|
157
157
|
const scan = {
|
|
158
|
-
docCount:
|
|
158
|
+
docCount: listings.length,
|
|
159
159
|
stale: [],
|
|
160
160
|
noTracking: [],
|
|
161
161
|
broken: [],
|
|
@@ -163,14 +163,11 @@ async function scanProjectFreshness(storageEngine, project) {
|
|
|
163
163
|
unverifiable: 0,
|
|
164
164
|
source: getCodeSource(project).label,
|
|
165
165
|
};
|
|
166
|
-
const checked = await mapWithConcurrency(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
170
|
-
for (const
|
|
171
|
-
if (!entry)
|
|
172
|
-
continue;
|
|
173
|
-
const { doc, report } = entry;
|
|
166
|
+
const checked = await mapWithConcurrency(listings, DOC_CONCURRENCY, async ({ summary, tracked_files }) => ({
|
|
167
|
+
doc: summary,
|
|
168
|
+
report: await computeFreshness(tracked_files, project),
|
|
169
|
+
}));
|
|
170
|
+
for (const { doc, report } of checked) {
|
|
174
171
|
if (report.sourceError)
|
|
175
172
|
scan.sourceError = report.sourceError;
|
|
176
173
|
if (report.status === "broken") {
|
|
@@ -46,31 +46,53 @@ function getLocalGitDiff(tracked, project) {
|
|
|
46
46
|
* Diffs tracked files against the branch they are tracked on, using the commit each snapshot
|
|
47
47
|
* was taken at as the base.
|
|
48
48
|
*
|
|
49
|
+
* A snapshot with no recorded commit — taken before branch tracking, or from a local working copy —
|
|
50
|
+
* is anchored on the newest commit at or before its date instead, so it diffs like any other rather
|
|
51
|
+
* than demanding a refresh first.
|
|
52
|
+
*
|
|
49
53
|
* Files are grouped by that base commit so one comparison covers every file snapshotted at the
|
|
50
54
|
* same revision — which, for a doc refreshed in one go, means a single API call.
|
|
51
55
|
*/
|
|
52
56
|
async function getGitHubDiffs(api, trackedFiles) {
|
|
53
57
|
const diffs = new Map();
|
|
54
58
|
const byBase = new Map();
|
|
59
|
+
const inferredBases = new Set();
|
|
55
60
|
for (const tracked of trackedFiles) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
let base = tracked.sourceRevision;
|
|
62
|
+
if (!base) {
|
|
63
|
+
try {
|
|
64
|
+
base = await api.resolveCommitAtDate(tracked.lastModifiedAt);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
68
|
+
diffs.set(tracked.path, ` [ERROR] No source commit recorded, and the commit at the snapshot date (${tracked.lastModifiedAt}) could not be resolved on ${api.label}: ${message}`);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (!base) {
|
|
72
|
+
diffs.set(tracked.path, ` [INFO] No source commit recorded, and ${api.label} has no commit at or before the snapshot date (${tracked.lastModifiedAt}) — nothing to diff against.\n` +
|
|
73
|
+
` → Call refresh_file_snapshot to re-anchor this file on ${api.label}.`);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
inferredBases.add(base);
|
|
60
77
|
}
|
|
61
|
-
const group = byBase.get(
|
|
78
|
+
const group = byBase.get(base);
|
|
62
79
|
if (group)
|
|
63
80
|
group.push(tracked);
|
|
64
81
|
else
|
|
65
|
-
byBase.set(
|
|
82
|
+
byBase.set(base, [tracked]);
|
|
66
83
|
}
|
|
67
84
|
if (byBase.size === 0)
|
|
68
85
|
return diffs;
|
|
69
86
|
const { commitSha: head } = await api.resolveRef();
|
|
70
87
|
for (const [base, files] of byBase) {
|
|
88
|
+
// An inferred base is the branch state at the snapshot date, not a commit the snapshot was
|
|
89
|
+
// provably read from — worth saying, since the diff can then include changes already documented.
|
|
90
|
+
const note = inferredBases.has(base)
|
|
91
|
+
? ` [INFO] Base commit ${base.slice(0, 7)} inferred from the snapshot date (no source commit recorded).\n\n`
|
|
92
|
+
: "";
|
|
71
93
|
if (base === head) {
|
|
72
94
|
for (const file of files) {
|
|
73
|
-
diffs.set(file.path,
|
|
95
|
+
diffs.set(file.path, `${note} [INFO] ${api.label} is still at the snapshot commit ${base.slice(0, 7)} — no changes.`);
|
|
74
96
|
}
|
|
75
97
|
continue;
|
|
76
98
|
}
|
|
@@ -81,12 +103,12 @@ async function getGitHubDiffs(api, trackedFiles) {
|
|
|
81
103
|
catch (err) {
|
|
82
104
|
const message = err instanceof Error ? err.message : String(err);
|
|
83
105
|
for (const file of files)
|
|
84
|
-
diffs.set(file.path,
|
|
106
|
+
diffs.set(file.path, `${note} [ERROR] Could not compare ${base.slice(0, 7)}...${head.slice(0, 7)}: ${message}`);
|
|
85
107
|
continue;
|
|
86
108
|
}
|
|
87
109
|
for (const file of files) {
|
|
88
110
|
const patch = patches.get(file.path);
|
|
89
|
-
diffs.set(file.path, patch ?? ` [INFO] No changes to this file between ${base.slice(0, 7)} and ${head.slice(0, 7)}.`);
|
|
111
|
+
diffs.set(file.path, note + (patch ?? ` [INFO] No changes to this file between ${base.slice(0, 7)} and ${head.slice(0, 7)}.`));
|
|
90
112
|
}
|
|
91
113
|
}
|
|
92
114
|
return diffs;
|
|
@@ -4,15 +4,15 @@ import { mapWithConcurrency } from "../core/concurrency.js";
|
|
|
4
4
|
* Fills in each summary's staleness flags, checking several docs at once — a listing is a
|
|
5
5
|
* whole-project scan, and doing it one doc at a time is what made large projects time out.
|
|
6
6
|
*/
|
|
7
|
-
async function flagStaleness(
|
|
8
|
-
await mapWithConcurrency(
|
|
9
|
-
|
|
10
|
-
if (!doc || doc.tracked_files.length === 0)
|
|
7
|
+
async function flagStaleness(listings, project) {
|
|
8
|
+
await mapWithConcurrency(listings, DOC_CONCURRENCY, async ({ summary, tracked_files }) => {
|
|
9
|
+
if (tracked_files.length === 0)
|
|
11
10
|
return;
|
|
12
|
-
const report = await computeFreshness(
|
|
11
|
+
const report = await computeFreshness(tracked_files, project);
|
|
13
12
|
summary.isStale = report.status === "stale";
|
|
14
13
|
summary.isBroken = report.status === "broken";
|
|
15
14
|
});
|
|
15
|
+
return listings.map((listing) => listing.summary);
|
|
16
16
|
}
|
|
17
17
|
function renderProjectDocs(summaries, totalLabel) {
|
|
18
18
|
if (summaries.length === 0)
|
|
@@ -52,8 +52,7 @@ export async function listDocs(storageEngine, args) {
|
|
|
52
52
|
const isMultiProject = projectsToList.length > 1;
|
|
53
53
|
if (!isMultiProject) {
|
|
54
54
|
const proj = projectsToList[0];
|
|
55
|
-
const summaries = await storageEngine.
|
|
56
|
-
await flagStaleness(storageEngine, summaries, proj);
|
|
55
|
+
const summaries = await flagStaleness(await storageEngine.listDocsDetailed(proj), proj);
|
|
57
56
|
if (summaries.length === 0) {
|
|
58
57
|
return { content: [{ type: "text", text: `No documentation entries found in project "${proj}".` }] };
|
|
59
58
|
}
|
|
@@ -64,8 +63,7 @@ export async function listDocs(storageEngine, args) {
|
|
|
64
63
|
const lines = [];
|
|
65
64
|
let grandTotal = 0;
|
|
66
65
|
for (const proj of projectsToList) {
|
|
67
|
-
const summaries = await storageEngine.
|
|
68
|
-
await flagStaleness(storageEngine, summaries, proj);
|
|
66
|
+
const summaries = await flagStaleness(await storageEngine.listDocsDetailed(proj), proj);
|
|
69
67
|
grandTotal += summaries.length;
|
|
70
68
|
lines.push(`\n🗂 ${proj} (${summaries.length})`);
|
|
71
69
|
lines.push(renderProjectDocs(summaries, ""));
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const APP_VERSION = "1.0.
|
|
1
|
+
export declare const APP_VERSION = "1.0.81";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated version file - do not edit manually
|
|
2
|
-
export const APP_VERSION = '1.0.
|
|
2
|
+
export const APP_VERSION = '1.0.81';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./index-
|
|
1
|
+
import{a0 as ln,a1 as an,a2 as y,a3 as tn,a4 as H,a5 as q,a6 as _,a7 as un,a8 as rn,a9 as L,aa as o,ab as B,ac as sn,ad as on,ae as fn}from"./index-T7ZLHNgs.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(fn(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,F=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<rn)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(on((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|