fix(publish): embed agent and session-context resources inside the clash crate#457
Merged
Conversation
6fcbdee to
1c42abb
Compare
…ash crate The published clash crate referenced files via include_str! that lived outside the package boundary (docs/, clash-amazonq/, clash-codex/, clash-copilot/, clash-gemini-ext/, clash-opencode/) and were reached at build time through symlinks inside clash/. cargo package skips symlinks pointing outside the package, so the v0.7.1 tarball on crates.io was missing every include_str! target and `cargo install clash` failed. Move the embedded assets to where they belong: alongside the code that embeds them. Per-agent install templates now live at clash/src/agent_templates/<agent>/, and session-context.md sits next to the handler that returns it. The five workspace-root clash-<agent>/ directories existed only as sources for include_str! — no script, package, or CI step consumed them — so they're removed entirely. The top-level docs/ directory keeps its workspace-level content intact; only session-context.md (the one file the clash binary actually embeds) moves into the crate. No symlinks remain. No package include allowlist changes are needed — everything ships via the existing src/**/* glob. Prose references in AGENTS.md and docs/multi-agent.md are updated to point at the new location.
1c42abb to
d20ba57
Compare
Contributor
|
merge! |
eliot-emp
approved these changes
May 14, 2026
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
cargo install clash@0.7.1fails because the published crate is missing everyinclude_str!target. The files lived outside theclash/package and were reached via symlinks insideclash/;cargo packageskips symlinks that point outside the package, so they never made it into the registry tarball.clash/src/agent_templates/<agent>/, andsession-context.mdsits inclash/src/next tohandlers.rs. Update the seveninclude_str!paths accordingly.AGENTS.md,docs/,install.sh,justfile,release.toml,clash-npm/,clash-vscode/,clash-pi/,site/,.github/workflows/) showed the five workspace-rootclash-<agent>/directories had no consumer other thanclash/src/cmd/init.rs'sinclude_str!calls — no CI, no install script, no separately-distributable package. They're removed entirely.docs/directory keeps its workspace-level content (plans, ADRs, multi-agent, etc.) intact. Onlysession-context.md— the one file theclashbinary actually embeds — moves into the crate.clash/Cargo.tomlinclude allowlist are needed since everything ships via the existingsrc/**/*glob.Diff scope
12 files changed, +16 / -20 lines. Eight pure renames, four small content edits (
init.rsandhandlers.rsinclude_str!paths;AGENTS.mdanddocs/multi-agent.mdprose updates).Test plan
cargo package --package clash --list --allow-dirtyincludes all eight previously-missing resource files at the new pathscargo check --package clashpassescargo install clashsucceeds from crates.ioHeads-up for the next release
cargo packagewith verification currently fails onmainbecause thecoding-agent-hooksworkspace dep (added after v0.7.1 in 8c230eb) isn't on crates.io yet. That blocks 0.7.2 untilcoding-agent-hooksis published first — separate from this PR but worth flagging.