Skip to content

refactor: reorganize internal modules into sub-packages#10

Merged
Oaklight merged 2 commits intomasterfrom
refactor/reorganize-internal-modules
Apr 3, 2026
Merged

refactor: reorganize internal modules into sub-packages#10
Oaklight merged 2 commits intomasterfrom
refactor/reorganize-internal-modules

Conversation

@Oaklight
Copy link
Copy Markdown
Owner

@Oaklight Oaklight commented Apr 3, 2026

Summary

  • Group AES encryption modules (_aes.py, _aes_openssl.py, _crypto.py) into _crypto/ sub-package
  • Group CLI utilities (_banner.py, _hook.py, _setup.py) into _cli/ sub-package
  • Keep backward-compat shim at _hook.py for deployed codex hook scripts
  • Public API unchanged, all 331 tests pass

Closes #9

Test plan

  • pytest tests/ — 331 passed
  • Public API import verification (from weilink import WeiLink, ILinkError, Message)
  • _crypto sub-package works (from weilink._crypto import ...)
  • _cli sub-package works (from weilink._cli import ...)
  • Backward-compat shim works (from weilink._hook import hook_poll)
  • ruff check and ruff format pass

Oaklight added 2 commits April 3, 2026 16:43
…kages

Group scattered underscore-prefixed modules into logical sub-packages:
- _crypto/: _aes.py, _aes_openssl.py, _crypto.py (AES encryption)
- _cli/: _banner.py, _hook.py, _setup.py (CLI-only utilities)

Public API unchanged. Backward-compat shim kept at _hook.py for
deployed codex hook scripts.

Closes #9
Add _BearerAuthMiddleware and token parameter to run_mcp() so that
SSE and streamable-http transports can require Authorization header.
Stdio transport ignores the token (no HTTP layer).
@Oaklight Oaklight merged commit b71d024 into master Apr 3, 2026
7 checks passed
@Oaklight
Copy link
Copy Markdown
Owner Author

Oaklight commented Apr 3, 2026

Note: This PR includes an unrelated commit (b71d024 — bearer token auth for MCP HTTP transports) that was previously staged but uncommitted in server/app.py. It was included here because cli.py already referenced run_mcp(..., token=token) (added in 56b6353), but the corresponding token parameter and _BearerAuthMiddleware in server/app.py had never been committed — causing the CI typecheck to fail until it was added. Ideally this should have been part of the original CLI integration commit (56b6353).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reorganize internal modules into sub-packages

1 participant