Skip to content

fix(publish): embed agent and session-context resources inside the clash crate#457

Merged
eliot-emp merged 1 commit into
mainfrom
akesling/fix-publish-symlinks
May 14, 2026
Merged

fix(publish): embed agent and session-context resources inside the clash crate#457
eliot-emp merged 1 commit into
mainfrom
akesling/fix-publish-symlinks

Conversation

@akesling

@akesling akesling commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cargo install clash@0.7.1 fails because the published crate is missing every include_str! target. The files lived outside the clash/ package and were reached via symlinks inside clash/; cargo package skips symlinks that point outside the package, so they never made it into the registry tarball.
  • 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 in clash/src/ next to handlers.rs. Update the seven include_str! paths accordingly.
  • An audit (AGENTS.md, docs/, install.sh, justfile, release.toml, clash-npm/, clash-vscode/, clash-pi/, site/, .github/workflows/) showed the five workspace-root clash-<agent>/ directories had no consumer other than clash/src/cmd/init.rs's include_str! calls — no CI, no install script, no separately-distributable package. They're removed entirely.
  • The top-level docs/ directory keeps its workspace-level content (plans, ADRs, multi-agent, etc.) intact. Only session-context.md — the one file the clash binary actually embeds — moves into the crate.
  • No symlinks remain. No changes to the clash/Cargo.toml include allowlist are needed since everything ships via the existing src/**/* glob.

Diff scope

12 files changed, +16 / -20 lines. Eight pure renames, four small content edits (init.rs and handlers.rs include_str! paths; AGENTS.md and docs/multi-agent.md prose updates).

Test plan

  • cargo package --package clash --list --allow-dirty includes all eight previously-missing resource files at the new paths
  • cargo check --package clash passes
  • After publishing a follow-up release, verify cargo install clash succeeds from crates.io

Heads-up for the next release

cargo package with verification currently fails on main because the coding-agent-hooks workspace dep (added after v0.7.1 in 8c230eb) isn't on crates.io yet. That blocks 0.7.2 until coding-agent-hooks is published first — separate from this PR but worth flagging.

@akesling akesling force-pushed the akesling/fix-publish-symlinks branch from 6fcbdee to 1c42abb Compare May 13, 2026 18:19
@akesling akesling changed the title fix(publish): host docs and agent resources inside clash/ for crates.io fix(publish): embed agent and session-context resources inside the clash crate May 13, 2026
@akesling akesling requested a review from eliothedeman May 13, 2026 18:40
…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.
@akesling akesling force-pushed the akesling/fix-publish-symlinks branch from 1c42abb to d20ba57 Compare May 13, 2026 19:27
@eliot-emp

Copy link
Copy Markdown
Contributor

merge!

@eliot-emp eliot-emp added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit f51f8c2 May 14, 2026
2 checks passed
@eliot-emp eliot-emp deleted the akesling/fix-publish-symlinks branch May 14, 2026 16:13
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.

3 participants