refactor(src): reorganize plaud_tools by surface (core/cli/mcp_pt/tray)#188
Merged
Conversation
Split the flat src/plaud_tools/ file list into packages grouped by
consumer, using real import fan-in/fan-out (not guesswork) to decide
ownership:
- core/ shared domain layer (client, session, auth, transport, models,
errors, appdata, layout, transcode, query, ai_clients) used by
2+ of cli/mcp/tray
- cli/ cli.py, doctor.py, and process_probe.py (renamed from
mcp_lifecycle.py — the old name outlived a prior dead-code
removal that left only a doctor-only process-enumerator probe)
- mcp_pt/ mcp.py, server.py (named mcp_pt, not mcp, to avoid shadowing
the `mcp` SDK package these modules import)
- tray/ unchanged, plus completions/, scripts/ (PS1 update/uninstall
templates), and ps1_templates.py consolidated in since they're
tray-exclusive by actual usage
assets/ and the repo-root /scripts/ stay put: assets/icon.ico is shared
by both the mcp_pt and tray PyInstaller builds, and /scripts/install.ps1
is fetched by a public raw-GitHub URL baked into the README.
No behavior, CLI/MCP surface, or entry-point change. Updated all
relative/absolute imports, pyproject.toml entry points + mypy overrides,
pyinstaller hiddenimports/data paths, CI/ADR comments, and current-state
docs (CLAUDE.md, CONTEXT.md, CONTRIBUTING.md) accordingly. Historical
docs (CHANGELOG entries, ADRs, plan docs) left untouched since they
describe what was true when written.
1027 tests pass, ruff/mypy clean, all four console-script entry points
verified against the reinstalled editable package.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Caught by CI: the earlier grep sweep for stale scripts/ references excluded .yml files, missing this hardcoded path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the flat
src/plaud_tools/file list into packages grouped by consumer, decided from actual import fan-in/fan-out rather than guesswork:core/— shared domain layer (client, session, auth, transport, models, errors, appdata, layout, transcode, query, ai_clients) used by 2+ of cli/mcp/traycli/—cli.py,doctor.py, andprocess_probe.py(renamed frommcp_lifecycle.py— the old name outlived a prior dead-code removal that left only a doctor-only process-enumerator probe)mcp_pt/—mcp.py,server.py(namedmcp_pt, notmcp, to avoid shadowing themcpSDK package these modules import)tray/— unchanged, pluscompletions/,scripts/(PS1 update/uninstall templates), andps1_templates.pyconsolidated in since they're tray-exclusive by actual usageassets/and the repo-root/scripts/stay put:assets/icon.icois shared by both themcp_ptandtrayPyInstaller builds, and/scripts/install.ps1is fetched by a public raw-GitHub URL baked into the README.No behavior, CLI/MCP surface, or entry-point change — pure module reorg. Also updated:
src/,tests/,scripts/pyproject.tomlentry points + mypy overridespyinstaller/*.spechiddenimports and bundled-data pathsCLAUDE.md,CONTEXT.md,CONTRIBUTING.md)Historical docs (CHANGELOG entries, ADRs, plan docs) were deliberately left untouched — they describe what was true when written.
Two bugs caught by the test suite during the move (both fixed here, not pre-existing):
ps1_templates.py's dev-mode path resolution broke when the file moved a directory deeper — fixed.--diagnose-enum's error string changed text, which would have silently defeated a regression test checking for the old string — test updated to match.Test plan
pytest -q -m "not live"— 1027 passedruff check src/ scripts/ tests/— cleanmypy src/plaud_tools— cleanpip install -e . --no-deps) and verified all four console-script entry points (plaud-tools,pt,plaud-mcp,plaud-tray) resolve and report the correct versionscripts_dir()and the newassets/completionspaths resolve correctly at runtime🤖 Generated with Claude Code