wikifier 4.3.0__tar.gz → 4.3.2__tar.gz
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.
- {wikifier-4.3.0/wikifier.egg-info → wikifier-4.3.2}/PKG-INFO +2 -2
- {wikifier-4.3.0 → wikifier-4.3.2}/README.md +1 -1
- {wikifier-4.3.0 → wikifier-4.3.2}/index.html +81 -5
- {wikifier-4.3.0 → wikifier-4.3.2}/skills/run.md +1 -1
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/__init__.py +1 -1
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/index.html +81 -5
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/scripts/wikifier.ps1 +8 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/scripts/wikifier.sh +19 -1
- {wikifier-4.3.0 → wikifier-4.3.2/wikifier.egg-info}/PKG-INFO +2 -2
- {wikifier-4.3.0 → wikifier-4.3.2}/CONTRIBUTING.md +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/LICENSE +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/MANIFEST.in +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/diagnostics.html +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/docs/spec.md +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/pyproject.toml +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/setup.cfg +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/tests/test_barrel_invalidation.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/tests/test_health.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/tests/test_import_cache.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/tests/test_parsers.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/__main__.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/cli.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/contracts.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/daemon.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/diagnostics.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/health.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/import_cache.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/library.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/locking.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/mcp/__init__.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/mcp/server.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/parsers/__init__.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/parsers/bree.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/parsers/cdia.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/parsers/javascript.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/parsers/python.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/resolution.py +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier/scripts/wikifier.bat +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier.egg-info/SOURCES.txt +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier.egg-info/dependency_links.txt +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier.egg-info/entry_points.txt +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier.egg-info/requires.txt +0 -0
- {wikifier-4.3.0 → wikifier-4.3.2}/wikifier.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wikifier
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Zero-dependency agent-to-agent codebase wiki for LLMs and AI agents. Autonomously maintained via record-change and mark-green for token-efficient lookup of files, dependencies, health, and summaries — across tiny scripts to 50k+ monorepos. Optional MCP server with rich tools for agents.
|
|
5
5
|
Author-email: Aron Amos <aron@example.com>
|
|
6
6
|
Maintainer: Aron Amos
|
|
@@ -137,7 +137,7 @@ Works with Claude Desktop, Claude Code, Cursor, Cline, and any Model Context Pro
|
|
|
137
137
|
|
|
138
138
|
## The Human Layer (Secondary, by Design)
|
|
139
139
|
|
|
140
|
-
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
140
|
+
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. View it with **`wikifier serve`** (then open http://localhost:8787/index.html) — browsers block `file://` fetches, so a double-clicked index.html can't read the wiki files; the page detects that case and shows you the fix. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
141
141
|
|
|
142
142
|
## Intended Use: Strictly Agent-to-Agent
|
|
143
143
|
|
|
@@ -105,7 +105,7 @@ Works with Claude Desktop, Claude Code, Cursor, Cline, and any Model Context Pro
|
|
|
105
105
|
|
|
106
106
|
## The Human Layer (Secondary, by Design)
|
|
107
107
|
|
|
108
|
-
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
108
|
+
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. View it with **`wikifier serve`** (then open http://localhost:8787/index.html) — browsers block `file://` fetches, so a double-clicked index.html can't read the wiki files; the page detects that case and shows you the fix. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
109
109
|
|
|
110
110
|
## Intended Use: Strictly Agent-to-Agent
|
|
111
111
|
|
|
@@ -5,7 +5,26 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Project Wiki</title>
|
|
7
7
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
|
-
|
|
8
|
+
<!-- Version PINNED: the bare mermaid@10 alias let the CDN serve different
|
|
9
|
+
minors with different config schemas (maxEdges top-level vs nested
|
|
10
|
+
under flowchart), making large-graph rendering nondeterministic. -->
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.9.3/dist/mermaid.min.js"></script>
|
|
12
|
+
<script>
|
|
13
|
+
// Configure Mermaid ONCE, immediately:
|
|
14
|
+
// - startOnLoad:false — the default auto-start processes .mermaid
|
|
15
|
+
// elements at page load with default config, racing the explicit
|
|
16
|
+
// render in loadMermaid().
|
|
17
|
+
// - maxEdges in BOTH placements — builds differ on where they read it
|
|
18
|
+
// (top-level is also a "secure" key, so it must be set here via
|
|
19
|
+
// initialize, never via in-diagram directives). Default 500 broke
|
|
20
|
+
// every repo whose graph used the generator's 600-edge budget.
|
|
21
|
+
if (window.mermaid) mermaid.initialize({
|
|
22
|
+
startOnLoad: false,
|
|
23
|
+
theme: 'dark',
|
|
24
|
+
maxEdges: 1500,
|
|
25
|
+
flowchart: { maxEdges: 1500 }
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
9
28
|
<style>
|
|
10
29
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600&display=swap');
|
|
11
30
|
|
|
@@ -161,7 +180,10 @@
|
|
|
161
180
|
class="text-xs px-3 py-1.5 rounded-xl bg-emerald-900/30 hover:bg-emerald-900/50 text-emerald-400 border border-emerald-800">Rebuild tree</button>
|
|
162
181
|
</div>
|
|
163
182
|
<div id="mermaid-container" class="bg-slate-950 border border-slate-800 rounded-2xl p-5 min-h-[340px]">
|
|
164
|
-
|
|
183
|
+
<!-- NOTE: no class="mermaid" here — that class marks
|
|
184
|
+
auto-start targets; the render target is the inner
|
|
185
|
+
<pre class="mermaid"> created by loadMermaid(). -->
|
|
186
|
+
<div id="mermaid-diagram"></div>
|
|
165
187
|
</div>
|
|
166
188
|
<div class="mt-4 flex flex-wrap gap-x-3 gap-y-2">
|
|
167
189
|
<button onclick="copyMermaidSource()"
|
|
@@ -593,12 +615,31 @@
|
|
|
593
615
|
|
|
594
616
|
const match = md.match(/```mermaid\n([\s\S]*?)```/);
|
|
595
617
|
if (match && match[1]) {
|
|
596
|
-
|
|
618
|
+
// textContent (not template-in-innerHTML) so the Mermaid source
|
|
619
|
+
// can never be interpreted as HTML.
|
|
620
|
+
container.innerHTML = '<pre class="mermaid"></pre>';
|
|
621
|
+
container.querySelector('.mermaid').textContent = match[1];
|
|
597
622
|
if (window.mermaid) {
|
|
598
623
|
try {
|
|
599
|
-
|
|
624
|
+
// Re-assert the same config as the early <head> init
|
|
625
|
+
// (some builds re-read it per render; keep both maxEdges
|
|
626
|
+
// placements — see the comment at the script tag).
|
|
627
|
+
mermaid.initialize({
|
|
628
|
+
startOnLoad: false,
|
|
629
|
+
theme: 'dark',
|
|
630
|
+
maxEdges: 1500,
|
|
631
|
+
flowchart: { maxEdges: 1500 }
|
|
632
|
+
});
|
|
600
633
|
await mermaid.run({ nodes: [container.querySelector('.mermaid')] });
|
|
601
|
-
} catch(e) {
|
|
634
|
+
} catch(e) {
|
|
635
|
+
// Never fail silently: show what broke + how to inspect.
|
|
636
|
+
const msg = (e && (e.message || e.str)) || String(e);
|
|
637
|
+
container.innerHTML = `<div class="text-sm p-4 bg-slate-900 border border-amber-700 rounded">
|
|
638
|
+
<div class="font-semibold mb-1 text-amber-400">Structure map could not be rendered</div>
|
|
639
|
+
<div class="text-slate-300 text-xs font-mono">${String(msg).replace(/[<>&]/g, c => ({'<':'<','>':'>','&':'&'}[c])).slice(0, 300)}</div>
|
|
640
|
+
<div class="mt-2 text-[11px] text-slate-400">The underlying map data in <span class="font-mono">library.md</span> is intact — use "Copy structure as text" or open library.md directly.</div>
|
|
641
|
+
</div>`;
|
|
642
|
+
}
|
|
602
643
|
}
|
|
603
644
|
} else {
|
|
604
645
|
container.innerHTML = `<div class="text-xs text-slate-400 p-4">No Mermaid diagram found in library.md.<br>Run <span class="font-mono text-emerald-400">wikifier update-maps</span> then refresh.</div>`;
|
|
@@ -770,9 +811,44 @@ Open index.html in the project for the live visual version.
|
|
|
770
811
|
}
|
|
771
812
|
|
|
772
813
|
// Boot: only what the human view needs (chart + files+descs + tree + monitor). Poll for live feel.
|
|
814
|
+
// Browsers refuse fetch() from file:// pages (unique-origin sandbox),
|
|
815
|
+
// so a double-clicked index.html can never read the wiki artifacts —
|
|
816
|
+
// the map stays empty while the console fills with CORS errors. Show
|
|
817
|
+
// the one-command fix prominently instead of failing silently.
|
|
818
|
+
function showFileProtocolNotice() {
|
|
819
|
+
const div = document.createElement('div');
|
|
820
|
+
div.id = 'file-protocol-notice';
|
|
821
|
+
div.style.cssText = 'position:sticky;top:0;z-index:60;background:#7c2d12;color:#ffedd5;padding:14px 18px;font-size:14px;line-height:1.6;box-shadow:0 2px 8px rgba(0,0,0,.4)';
|
|
822
|
+
div.innerHTML = '<strong>The dashboard cannot read the wiki files when opened directly from disk.</strong><br>' +
|
|
823
|
+
'Browsers block <code>fetch()</code> on <code>file://</code> pages (security sandbox), so the map and file list would stay empty. ' +
|
|
824
|
+
'Serve this folder over localhost instead — run one of these in the project folder, then open the link:' +
|
|
825
|
+
'<div style="margin-top:8px;display:flex;gap:8px;flex-wrap:wrap;align-items:center">' +
|
|
826
|
+
'<button id="fpCopyServe" style="background:#10b981;color:#06281e;border:none;border-radius:6px;padding:6px 12px;font-weight:600;cursor:pointer">Copy: wikifier serve</button>' +
|
|
827
|
+
'<button id="fpCopyPy" style="background:#374151;color:#e5e7eb;border:none;border-radius:6px;padding:6px 12px;cursor:pointer">Copy: python3 -m http.server 8787</button>' +
|
|
828
|
+
'<a href="http://localhost:8787/index.html" style="color:#5eead4;text-decoration:underline">open http://localhost:8787/index.html</a>' +
|
|
829
|
+
'</div>';
|
|
830
|
+
document.body.prepend(div);
|
|
831
|
+
const wire = (id, text) => {
|
|
832
|
+
const b = document.getElementById(id);
|
|
833
|
+
if (!b) return;
|
|
834
|
+
b.onclick = () => navigator.clipboard.writeText(text).then(() => {
|
|
835
|
+
const old = b.textContent;
|
|
836
|
+
b.textContent = 'Copied ✓';
|
|
837
|
+
setTimeout(() => { b.textContent = old; }, 1600);
|
|
838
|
+
});
|
|
839
|
+
};
|
|
840
|
+
wire('fpCopyServe', 'wikifier serve');
|
|
841
|
+
wire('fpCopyPy', 'python3 -m http.server 8787');
|
|
842
|
+
}
|
|
843
|
+
|
|
773
844
|
function boot() {
|
|
774
845
|
initTailwind();
|
|
775
846
|
|
|
847
|
+
if (location.protocol === 'file:') {
|
|
848
|
+
showFileProtocolNotice();
|
|
849
|
+
return; // skip data loads + polling: every fetch would fail
|
|
850
|
+
}
|
|
851
|
+
|
|
776
852
|
loadHealthMatrix();
|
|
777
853
|
loadMermaid();
|
|
778
854
|
loadMonitorStatus();
|
|
@@ -250,4 +250,4 @@ All support `project_root=...` and return structured data (plus side-effecting s
|
|
|
250
250
|
|
|
251
251
|
See README.md "Intended Use" for the strict agent-to-agent wiki scope (token saving for lookup + autonomous update/create of wiki entries only). M5 dogfood validated this on real external projects with the exact patterns above. Recent 4.0.1 hygiene (health coerce + superseded prune) further improves reliability of the matrix for agents doing direct lookups/updates.
|
|
252
252
|
|
|
253
|
-
**Human investigation layer (secondary, opt-in)**: `wikifier init` copies only `index.html` (the clean human wiki viewer) into the target project (the folder where MCP/CLI run). `diagnostics.html` (Wikifier maintainer hub) is no longer copied — it would show the wrong tree (Wikifier's internals) and be stale for the host project. Humans
|
|
253
|
+
**Human investigation layer (secondary, opt-in)**: `wikifier init` copies only `index.html` (the clean human wiki viewer) into the target project (the folder where MCP/CLI run). `diagnostics.html` (Wikifier maintainer hub) is no longer copied — it would show the wrong tree (Wikifier's internals) and be stale for the host project. Humans run `wikifier serve` and open http://localhost:8787/index.html (browsers block file:// fetches, so a double-clicked index.html shows an empty map — the page itself now detects this and shows the fix) to see a clean visual of *that project's* agent-maintained wiki: prominent code structure / dependency chart (Mermaid) as the hero, followed by a simple "Files & descriptions" list (paths + short "what this file is about" summaries pulled from the wiki notes), and a lightweight "Browse by folder" tree derived from the health data. A "Quick actions" toolbar provides one-click copy buttons for the main commands (check-changes, update-maps, monitor &); empty states ("No structure map yet", "No files in the wiki yet") have prominent primary buttons for first-time commands (update-maps prioritized, combined check-changes+update-maps for files). On first open with no map, the `wikifier update-maps` command is auto-copied (sessionStorage-guarded one-time per browser session) and live-wait mode is immediately activated. Buttons use copy + live-wait: they copy the exact command and inject a fixed top "Waiting for `wikifier ...` to produce data... (auto-polling)" banner with aggressive 3s polling that auto-detects when library.md / file_health.* update (from the terminal run) and refreshes the chart/files automatically; includes an "I ran it — refresh now" link in the banner and a success toast on detection. A short explanatory note in the UI clarifies the model: this is a pure static zero-dep viewer (browser JS cannot execute host shell commands due to security sandbox); the auto we provide is copy + immediate live-wait + fast poll so results (trees, files, descriptions) appear automatically after the user pastes/runs in their terminal. "Good enough" acceptance recorded for this copy+live-wait UX. Prominent copy buttons also export "structure as text" (Mermaid source) and a clean full snapshot (tree + file list + descriptions) — exactly the compact, token-saving view agents use. The default human page is intentionally free of dense agent internals (those live in `diagnostics.html` in the Wikifier source for technical users). If an old diagnostics.html is present, it can be safely deleted. The .md files + MCP/CLI/tools remain the primary SSOT and update mechanism for agents. This layer lets humans (or teams) visually investigate and copy-paste wiki summaries for their own work / LLM chats without touching agent behavior or adding deps.
|
|
@@ -5,7 +5,26 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Project Wiki</title>
|
|
7
7
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
|
-
|
|
8
|
+
<!-- Version PINNED: the bare mermaid@10 alias let the CDN serve different
|
|
9
|
+
minors with different config schemas (maxEdges top-level vs nested
|
|
10
|
+
under flowchart), making large-graph rendering nondeterministic. -->
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.9.3/dist/mermaid.min.js"></script>
|
|
12
|
+
<script>
|
|
13
|
+
// Configure Mermaid ONCE, immediately:
|
|
14
|
+
// - startOnLoad:false — the default auto-start processes .mermaid
|
|
15
|
+
// elements at page load with default config, racing the explicit
|
|
16
|
+
// render in loadMermaid().
|
|
17
|
+
// - maxEdges in BOTH placements — builds differ on where they read it
|
|
18
|
+
// (top-level is also a "secure" key, so it must be set here via
|
|
19
|
+
// initialize, never via in-diagram directives). Default 500 broke
|
|
20
|
+
// every repo whose graph used the generator's 600-edge budget.
|
|
21
|
+
if (window.mermaid) mermaid.initialize({
|
|
22
|
+
startOnLoad: false,
|
|
23
|
+
theme: 'dark',
|
|
24
|
+
maxEdges: 1500,
|
|
25
|
+
flowchart: { maxEdges: 1500 }
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
9
28
|
<style>
|
|
10
29
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600&display=swap');
|
|
11
30
|
|
|
@@ -161,7 +180,10 @@
|
|
|
161
180
|
class="text-xs px-3 py-1.5 rounded-xl bg-emerald-900/30 hover:bg-emerald-900/50 text-emerald-400 border border-emerald-800">Rebuild tree</button>
|
|
162
181
|
</div>
|
|
163
182
|
<div id="mermaid-container" class="bg-slate-950 border border-slate-800 rounded-2xl p-5 min-h-[340px]">
|
|
164
|
-
|
|
183
|
+
<!-- NOTE: no class="mermaid" here — that class marks
|
|
184
|
+
auto-start targets; the render target is the inner
|
|
185
|
+
<pre class="mermaid"> created by loadMermaid(). -->
|
|
186
|
+
<div id="mermaid-diagram"></div>
|
|
165
187
|
</div>
|
|
166
188
|
<div class="mt-4 flex flex-wrap gap-x-3 gap-y-2">
|
|
167
189
|
<button onclick="copyMermaidSource()"
|
|
@@ -593,12 +615,31 @@
|
|
|
593
615
|
|
|
594
616
|
const match = md.match(/```mermaid\n([\s\S]*?)```/);
|
|
595
617
|
if (match && match[1]) {
|
|
596
|
-
|
|
618
|
+
// textContent (not template-in-innerHTML) so the Mermaid source
|
|
619
|
+
// can never be interpreted as HTML.
|
|
620
|
+
container.innerHTML = '<pre class="mermaid"></pre>';
|
|
621
|
+
container.querySelector('.mermaid').textContent = match[1];
|
|
597
622
|
if (window.mermaid) {
|
|
598
623
|
try {
|
|
599
|
-
|
|
624
|
+
// Re-assert the same config as the early <head> init
|
|
625
|
+
// (some builds re-read it per render; keep both maxEdges
|
|
626
|
+
// placements — see the comment at the script tag).
|
|
627
|
+
mermaid.initialize({
|
|
628
|
+
startOnLoad: false,
|
|
629
|
+
theme: 'dark',
|
|
630
|
+
maxEdges: 1500,
|
|
631
|
+
flowchart: { maxEdges: 1500 }
|
|
632
|
+
});
|
|
600
633
|
await mermaid.run({ nodes: [container.querySelector('.mermaid')] });
|
|
601
|
-
} catch(e) {
|
|
634
|
+
} catch(e) {
|
|
635
|
+
// Never fail silently: show what broke + how to inspect.
|
|
636
|
+
const msg = (e && (e.message || e.str)) || String(e);
|
|
637
|
+
container.innerHTML = `<div class="text-sm p-4 bg-slate-900 border border-amber-700 rounded">
|
|
638
|
+
<div class="font-semibold mb-1 text-amber-400">Structure map could not be rendered</div>
|
|
639
|
+
<div class="text-slate-300 text-xs font-mono">${String(msg).replace(/[<>&]/g, c => ({'<':'<','>':'>','&':'&'}[c])).slice(0, 300)}</div>
|
|
640
|
+
<div class="mt-2 text-[11px] text-slate-400">The underlying map data in <span class="font-mono">library.md</span> is intact — use "Copy structure as text" or open library.md directly.</div>
|
|
641
|
+
</div>`;
|
|
642
|
+
}
|
|
602
643
|
}
|
|
603
644
|
} else {
|
|
604
645
|
container.innerHTML = `<div class="text-xs text-slate-400 p-4">No Mermaid diagram found in library.md.<br>Run <span class="font-mono text-emerald-400">wikifier update-maps</span> then refresh.</div>`;
|
|
@@ -770,9 +811,44 @@ Open index.html in the project for the live visual version.
|
|
|
770
811
|
}
|
|
771
812
|
|
|
772
813
|
// Boot: only what the human view needs (chart + files+descs + tree + monitor). Poll for live feel.
|
|
814
|
+
// Browsers refuse fetch() from file:// pages (unique-origin sandbox),
|
|
815
|
+
// so a double-clicked index.html can never read the wiki artifacts —
|
|
816
|
+
// the map stays empty while the console fills with CORS errors. Show
|
|
817
|
+
// the one-command fix prominently instead of failing silently.
|
|
818
|
+
function showFileProtocolNotice() {
|
|
819
|
+
const div = document.createElement('div');
|
|
820
|
+
div.id = 'file-protocol-notice';
|
|
821
|
+
div.style.cssText = 'position:sticky;top:0;z-index:60;background:#7c2d12;color:#ffedd5;padding:14px 18px;font-size:14px;line-height:1.6;box-shadow:0 2px 8px rgba(0,0,0,.4)';
|
|
822
|
+
div.innerHTML = '<strong>The dashboard cannot read the wiki files when opened directly from disk.</strong><br>' +
|
|
823
|
+
'Browsers block <code>fetch()</code> on <code>file://</code> pages (security sandbox), so the map and file list would stay empty. ' +
|
|
824
|
+
'Serve this folder over localhost instead — run one of these in the project folder, then open the link:' +
|
|
825
|
+
'<div style="margin-top:8px;display:flex;gap:8px;flex-wrap:wrap;align-items:center">' +
|
|
826
|
+
'<button id="fpCopyServe" style="background:#10b981;color:#06281e;border:none;border-radius:6px;padding:6px 12px;font-weight:600;cursor:pointer">Copy: wikifier serve</button>' +
|
|
827
|
+
'<button id="fpCopyPy" style="background:#374151;color:#e5e7eb;border:none;border-radius:6px;padding:6px 12px;cursor:pointer">Copy: python3 -m http.server 8787</button>' +
|
|
828
|
+
'<a href="http://localhost:8787/index.html" style="color:#5eead4;text-decoration:underline">open http://localhost:8787/index.html</a>' +
|
|
829
|
+
'</div>';
|
|
830
|
+
document.body.prepend(div);
|
|
831
|
+
const wire = (id, text) => {
|
|
832
|
+
const b = document.getElementById(id);
|
|
833
|
+
if (!b) return;
|
|
834
|
+
b.onclick = () => navigator.clipboard.writeText(text).then(() => {
|
|
835
|
+
const old = b.textContent;
|
|
836
|
+
b.textContent = 'Copied ✓';
|
|
837
|
+
setTimeout(() => { b.textContent = old; }, 1600);
|
|
838
|
+
});
|
|
839
|
+
};
|
|
840
|
+
wire('fpCopyServe', 'wikifier serve');
|
|
841
|
+
wire('fpCopyPy', 'python3 -m http.server 8787');
|
|
842
|
+
}
|
|
843
|
+
|
|
773
844
|
function boot() {
|
|
774
845
|
initTailwind();
|
|
775
846
|
|
|
847
|
+
if (location.protocol === 'file:') {
|
|
848
|
+
showFileProtocolNotice();
|
|
849
|
+
return; // skip data loads + polling: every fetch would fail
|
|
850
|
+
}
|
|
851
|
+
|
|
776
852
|
loadHealthMatrix();
|
|
777
853
|
loadMermaid();
|
|
778
854
|
loadMonitorStatus();
|
|
@@ -84,6 +84,7 @@ Core:
|
|
|
84
84
|
mark-green <file>
|
|
85
85
|
health
|
|
86
86
|
monitor
|
|
87
|
+
serve [port]
|
|
87
88
|
update-maps
|
|
88
89
|
init
|
|
89
90
|
|
|
@@ -160,6 +161,13 @@ dist
|
|
|
160
161
|
Start-Sleep -Seconds 30
|
|
161
162
|
}
|
|
162
163
|
}
|
|
164
|
+
"serve" {
|
|
165
|
+
# Browsers block fetch() on file:// pages, so index.html must be served.
|
|
166
|
+
$port = if ($Arguments -and $Arguments[0]) { $Arguments[0] } else { "8787" }
|
|
167
|
+
Write-Log "Serving $WikifierRoot at http://localhost:$port/index.html (Ctrl+C to stop)"
|
|
168
|
+
Set-Location $WikifierRoot
|
|
169
|
+
python -m http.server $port --bind 127.0.0.1
|
|
170
|
+
}
|
|
163
171
|
default {
|
|
164
172
|
Write-Err "Unknown command '$Command'. Try 'wikifier help'."
|
|
165
173
|
}
|
|
@@ -258,6 +258,9 @@ Core Commands:
|
|
|
258
258
|
update-maps Rebuild library.md with import/dependency Mermaid graph.
|
|
259
259
|
validate Check that every monitored file has at least a stub wiki entry.
|
|
260
260
|
monitor Background heartbeat: runs check-changes every 30s forever.
|
|
261
|
+
serve [port] Serve the project folder on localhost (default 8787) so the
|
|
262
|
+
index.html dashboard can read the wiki files (browsers block
|
|
263
|
+
file:// fetches — do not double-click index.html).
|
|
261
264
|
daemon <start|stop|status|logs|restart|run|install-service|uninstall-service>
|
|
262
265
|
Long-running daemon for continuous health matrix + dependency freshness.
|
|
263
266
|
Survives laptop sleep/lid close via wake detection. Supports systemd user service.
|
|
@@ -493,6 +496,20 @@ cmd_monitor() {
|
|
|
493
496
|
done
|
|
494
497
|
}
|
|
495
498
|
|
|
499
|
+
cmd_serve() {
|
|
500
|
+
# Serve the project folder over localhost so the human dashboard
|
|
501
|
+
# (index.html) can fetch the wiki artifacts. Browsers block fetch() on
|
|
502
|
+
# file:// pages, so a double-clicked index.html always shows an empty map
|
|
503
|
+
# — the dashboard itself now explains this and points here.
|
|
504
|
+
local port="${1:-8787}"
|
|
505
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
506
|
+
error "serve requires python3 (uses the stdlib http.server)."
|
|
507
|
+
return 1
|
|
508
|
+
fi
|
|
509
|
+
log "Serving $PROJECT_ROOT at http://localhost:$port/index.html (Ctrl+C to stop)"
|
|
510
|
+
( cd "$PROJECT_ROOT" && exec python3 -m http.server "$port" --bind 127.0.0.1 )
|
|
511
|
+
}
|
|
512
|
+
|
|
496
513
|
cmd_update_maps() {
|
|
497
514
|
# Thin delegation (the long-stated "shell becomes thin" goal): the full
|
|
498
515
|
# pipeline — dirty detection, in-process parsing, canonical cache persist,
|
|
@@ -694,7 +711,7 @@ EOT
|
|
|
694
711
|
|
|
695
712
|
log "✅ Wikifier initialised in $target_dir . Edit monitored_paths.txt to point at your real codebase (or subdirs for monorepos)."
|
|
696
713
|
log " Recommended: export WIKIFIER_PROJECT_ROOT=$target_dir (or cd there and use ./wikifier.sh)"
|
|
697
|
-
log " Human layer: open index.html
|
|
714
|
+
log " Human layer: run 'wikifier serve' and open http://localhost:8787/index.html for this project's code structure chart + files + descriptions (browsers block file:// fetches, so don't double-click index.html — the page will tell you the same). Use the copy buttons for clean text exports (tree + snapshot) to LLMs or teammates."
|
|
698
715
|
}
|
|
699
716
|
|
|
700
717
|
cmd_cycles() {
|
|
@@ -804,6 +821,7 @@ main() {
|
|
|
804
821
|
prepare-edit) cmd_prepare_edit "$@" ;;
|
|
805
822
|
mark-green) cmd_mark_green "$@" ;;
|
|
806
823
|
monitor) cmd_monitor ;;
|
|
824
|
+
serve) cmd_serve "$@" ;;
|
|
807
825
|
daemon) python3 -m wikifier.daemon "$@" ;;
|
|
808
826
|
update-maps) cmd_update_maps "$@" ;;
|
|
809
827
|
validate) cmd_validate ;;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wikifier
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Zero-dependency agent-to-agent codebase wiki for LLMs and AI agents. Autonomously maintained via record-change and mark-green for token-efficient lookup of files, dependencies, health, and summaries — across tiny scripts to 50k+ monorepos. Optional MCP server with rich tools for agents.
|
|
5
5
|
Author-email: Aron Amos <aron@example.com>
|
|
6
6
|
Maintainer: Aron Amos
|
|
@@ -137,7 +137,7 @@ Works with Claude Desktop, Claude Code, Cursor, Cline, and any Model Context Pro
|
|
|
137
137
|
|
|
138
138
|
## The Human Layer (Secondary, by Design)
|
|
139
139
|
|
|
140
|
-
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
140
|
+
`wikifier init` copies a single static `index.html` into your project: a read-only dashboard showing the Mermaid code-structure chart, files with short descriptions, and a folder browser — useful for humans investigating what the agents know. View it with **`wikifier serve`** (then open http://localhost:8787/index.html) — browsers block `file://` fetches, so a double-clicked index.html can't read the wiki files; the page detects that case and shows you the fix. Command buttons copy the exact CLI command and live-poll for results (a static page can't execute shell commands — that's the browser sandbox working as intended). The agent-facing markdown files and tools remain the single source of truth.
|
|
141
141
|
|
|
142
142
|
## Intended Use: Strictly Agent-to-Agent
|
|
143
143
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|