wikifier 4.3.0__tar.gz → 4.3.1__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.
Files changed (43) hide show
  1. {wikifier-4.3.0/wikifier.egg-info → wikifier-4.3.1}/PKG-INFO +2 -2
  2. {wikifier-4.3.0 → wikifier-4.3.1}/README.md +1 -1
  3. {wikifier-4.3.0 → wikifier-4.3.1}/index.html +35 -0
  4. {wikifier-4.3.0 → wikifier-4.3.1}/skills/run.md +1 -1
  5. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/__init__.py +1 -1
  6. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/index.html +35 -0
  7. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/scripts/wikifier.ps1 +8 -0
  8. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/scripts/wikifier.sh +19 -1
  9. {wikifier-4.3.0 → wikifier-4.3.1/wikifier.egg-info}/PKG-INFO +2 -2
  10. {wikifier-4.3.0 → wikifier-4.3.1}/CONTRIBUTING.md +0 -0
  11. {wikifier-4.3.0 → wikifier-4.3.1}/LICENSE +0 -0
  12. {wikifier-4.3.0 → wikifier-4.3.1}/MANIFEST.in +0 -0
  13. {wikifier-4.3.0 → wikifier-4.3.1}/diagnostics.html +0 -0
  14. {wikifier-4.3.0 → wikifier-4.3.1}/docs/spec.md +0 -0
  15. {wikifier-4.3.0 → wikifier-4.3.1}/pyproject.toml +0 -0
  16. {wikifier-4.3.0 → wikifier-4.3.1}/setup.cfg +0 -0
  17. {wikifier-4.3.0 → wikifier-4.3.1}/tests/test_barrel_invalidation.py +0 -0
  18. {wikifier-4.3.0 → wikifier-4.3.1}/tests/test_health.py +0 -0
  19. {wikifier-4.3.0 → wikifier-4.3.1}/tests/test_import_cache.py +0 -0
  20. {wikifier-4.3.0 → wikifier-4.3.1}/tests/test_parsers.py +0 -0
  21. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/__main__.py +0 -0
  22. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/cli.py +0 -0
  23. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/contracts.py +0 -0
  24. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/daemon.py +0 -0
  25. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/diagnostics.py +0 -0
  26. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/health.py +0 -0
  27. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/import_cache.py +0 -0
  28. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/library.py +0 -0
  29. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/locking.py +0 -0
  30. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/mcp/__init__.py +0 -0
  31. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/mcp/server.py +0 -0
  32. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/parsers/__init__.py +0 -0
  33. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/parsers/bree.py +0 -0
  34. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/parsers/cdia.py +0 -0
  35. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/parsers/javascript.py +0 -0
  36. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/parsers/python.py +0 -0
  37. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/resolution.py +0 -0
  38. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier/scripts/wikifier.bat +0 -0
  39. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier.egg-info/SOURCES.txt +0 -0
  40. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier.egg-info/dependency_links.txt +0 -0
  41. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier.egg-info/entry_points.txt +0 -0
  42. {wikifier-4.3.0 → wikifier-4.3.1}/wikifier.egg-info/requires.txt +0 -0
  43. {wikifier-4.3.0 → wikifier-4.3.1}/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.0
3
+ Version: 4.3.1
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
 
@@ -770,9 +770,44 @@ Open index.html in the project for the live visual version.
770
770
  }
771
771
 
772
772
  // Boot: only what the human view needs (chart + files+descs + tree + monitor). Poll for live feel.
773
+ // Browsers refuse fetch() from file:// pages (unique-origin sandbox),
774
+ // so a double-clicked index.html can never read the wiki artifacts —
775
+ // the map stays empty while the console fills with CORS errors. Show
776
+ // the one-command fix prominently instead of failing silently.
777
+ function showFileProtocolNotice() {
778
+ const div = document.createElement('div');
779
+ div.id = 'file-protocol-notice';
780
+ 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)';
781
+ div.innerHTML = '<strong>The dashboard cannot read the wiki files when opened directly from disk.</strong><br>' +
782
+ 'Browsers block <code>fetch()</code> on <code>file://</code> pages (security sandbox), so the map and file list would stay empty. ' +
783
+ 'Serve this folder over localhost instead — run one of these in the project folder, then open the link:' +
784
+ '<div style="margin-top:8px;display:flex;gap:8px;flex-wrap:wrap;align-items:center">' +
785
+ '<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>' +
786
+ '<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>' +
787
+ '<a href="http://localhost:8787/index.html" style="color:#5eead4;text-decoration:underline">open http://localhost:8787/index.html</a>' +
788
+ '</div>';
789
+ document.body.prepend(div);
790
+ const wire = (id, text) => {
791
+ const b = document.getElementById(id);
792
+ if (!b) return;
793
+ b.onclick = () => navigator.clipboard.writeText(text).then(() => {
794
+ const old = b.textContent;
795
+ b.textContent = 'Copied ✓';
796
+ setTimeout(() => { b.textContent = old; }, 1600);
797
+ });
798
+ };
799
+ wire('fpCopyServe', 'wikifier serve');
800
+ wire('fpCopyPy', 'python3 -m http.server 8787');
801
+ }
802
+
773
803
  function boot() {
774
804
  initTailwind();
775
805
 
806
+ if (location.protocol === 'file:') {
807
+ showFileProtocolNotice();
808
+ return; // skip data loads + polling: every fetch would fail
809
+ }
810
+
776
811
  loadHealthMatrix();
777
812
  loadMermaid();
778
813
  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 open the local `index.html` (via `python -m http.server` recommended) 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.
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.
@@ -61,4 +61,4 @@ from .contracts import (
61
61
  compute_acs_confidence,
62
62
  )
63
63
 
64
- __version__ = "4.3.0"
64
+ __version__ = "4.3.1"
@@ -770,9 +770,44 @@ Open index.html in the project for the live visual version.
770
770
  }
771
771
 
772
772
  // Boot: only what the human view needs (chart + files+descs + tree + monitor). Poll for live feel.
773
+ // Browsers refuse fetch() from file:// pages (unique-origin sandbox),
774
+ // so a double-clicked index.html can never read the wiki artifacts —
775
+ // the map stays empty while the console fills with CORS errors. Show
776
+ // the one-command fix prominently instead of failing silently.
777
+ function showFileProtocolNotice() {
778
+ const div = document.createElement('div');
779
+ div.id = 'file-protocol-notice';
780
+ 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)';
781
+ div.innerHTML = '<strong>The dashboard cannot read the wiki files when opened directly from disk.</strong><br>' +
782
+ 'Browsers block <code>fetch()</code> on <code>file://</code> pages (security sandbox), so the map and file list would stay empty. ' +
783
+ 'Serve this folder over localhost instead — run one of these in the project folder, then open the link:' +
784
+ '<div style="margin-top:8px;display:flex;gap:8px;flex-wrap:wrap;align-items:center">' +
785
+ '<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>' +
786
+ '<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>' +
787
+ '<a href="http://localhost:8787/index.html" style="color:#5eead4;text-decoration:underline">open http://localhost:8787/index.html</a>' +
788
+ '</div>';
789
+ document.body.prepend(div);
790
+ const wire = (id, text) => {
791
+ const b = document.getElementById(id);
792
+ if (!b) return;
793
+ b.onclick = () => navigator.clipboard.writeText(text).then(() => {
794
+ const old = b.textContent;
795
+ b.textContent = 'Copied ✓';
796
+ setTimeout(() => { b.textContent = old; }, 1600);
797
+ });
798
+ };
799
+ wire('fpCopyServe', 'wikifier serve');
800
+ wire('fpCopyPy', 'python3 -m http.server 8787');
801
+ }
802
+
773
803
  function boot() {
774
804
  initTailwind();
775
805
 
806
+ if (location.protocol === 'file:') {
807
+ showFileProtocolNotice();
808
+ return; // skip data loads + polling: every fetch would fail
809
+ }
810
+
776
811
  loadHealthMatrix();
777
812
  loadMermaid();
778
813
  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 in browser for this project's code structure chart + files + descriptions (auto-refreshes with monitor). Use the copy buttons for clean text exports (tree + snapshot) to LLMs or teammates."
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.0
3
+ Version: 4.3.1
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