Skip to content

Vendor the server code into the client plugin folder - #54

Merged
HarperZ9 merged 1 commit into
mainfrom
claude/vendor-server-code
Oct 2, 2026
Merged

HarperZ9 merged 1 commit into
mainfrom
claude/vendor-server-code

Conversation

@HarperZ9

@HarperZ9 HarperZ9 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Changes

  • client-plugin/server/src/index_graph/: 120 vendored files, the same selection and bytes the source ZIP places under server/src/.
  • scripts/build_client_package.py: vendored_payload() and plugin_entries() reuse the builder's own entries() selection; --sync-vendored rewrites the folder from src/ and deletes stale files. Build inputs exclude the vendored copy, so the ZIP takes server/src from src/ once.
  • client-plugin/server/serve.py: no fallback to the repository's src. A missing copy prints index: the server code is missing from the plugin folder. Reinstall the plugin. and exits 1. -I -S -B unchanged.
  • client-plugin/.claude-plugin/icon.png: now the 512 px canon PNG (99 KiB). The 1024 px file is 273 KiB, over the 256 KiB per-file limit, and lossless recompression only reached 268 KiB.
  • README install text says the folder carries its own server code. The "What this plugin runs and handles" facts are unchanged. The Git environment-copy code is unchanged.
  • CHANGELOG Unreleased entry. No version bump.

Tests

  • Drift test against the builder (missing, extra or changed file, CRLF normalized), naming the sync command.
  • Isolated launch: copies only client-plugin/, runs the exact .mcp.json command with ${CLAUDE_PLUGIN_ROOT} and ${user_config.*} substituted, checks initialize and tools/list, then removes server/src and checks the one-line message and exit 1.
  • Limits: 131 files (limit 512), no file at or above 256 KiB (largest 99 KiB icon, largest code file router_jobs.py 41 KiB), no .gitattributes in the folder.
  • python -m pytest: 937 passed. Manual check from a fresh clone of this branch with only the plugin folder returned 6 tools. claude plugin validate passes with the five directory-field warnings.

🤖 Generated with Claude Code

A directory install receives only client-plugin/, so the launcher could not
import index_graph. The folder now carries server/src/index_graph, the same
files the source ZIP places there. build_client_package.py --sync-vendored
rewrites it from src/, the builder excludes it from plugin inputs so nothing
is counted twice, and a test fails on any drift and names the sync command.
The launcher drops the fallback to the repository's src and exits 1 with a
one-line message when the copy is missing. New tests launch the folder alone
with the exact Claude command and check the 512-file and 256 KiB limits. The
icon moves to the 512 px PNG, since the 1024 px file is 273 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HarperZ9
HarperZ9 merged commit a0ad9d1 into main Oct 2, 2026
2 checks passed
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.

1 participant