feat(deeplink): add deeplink command importing provider/mcp/prompt/skill#226
feat(deeplink): add deeplink command importing provider/mcp/prompt/skill#226LeonardoTan19 wants to merge 8 commits into
deeplink command importing provider/mcp/prompt/skill#226Conversation
Pull src/deeplink/{mcp,prompt,skill}.rs from farion1231/cc-switch.
These implement library-level deeplink import for resource types beyond
provider; parser dispatch and CLI wiring follow in subsequent commits.
…skill Wire the ported mcp/prompt/skill handlers into the deeplink parser and re-exports, then expose a top-level `cc-switch deeplink <url>` command that dispatches by the URL's `resource` type. The deep link's own `app`/`apps` parameters drive the target, so the global `--app` flag is ignored here. Also align imported-prompt timestamps to seconds to match the prompt store (upstream used milliseconds, which rendered far-future dates).
Add integration tests for the new resource types: MCP server persistence with merged app flags, prompt import with enabled/disabled states, and skill repo registration, plus a malformed-repo rejection case.
- Align parser.rs with upstream cc-switch: add hermes to provider app validation, use local variable extraction style consistently - Fix MCP import merge logic missing opencode/hermes app flags for existing servers - Remove misleading hint message that referenced non-existent command
|
@SaladDay |
… dispatch/MCP/parser/cross-app coverage - Merge three OpenClaw config rejection tests into one parameterized test - Add command dispatch test covering all four resource types via execute() - Add MCP apps=openclaw-only late-error behavior test - Add cross-app prompt import test for codex - Add parser error tests: unknown resource, missing params, invalid MCP app - 17 tests total, zero semantic changes
|
@LeonardoTan19 I think the cleanest behavior is to make the deeplink URL the single source of truth for target apps. So If users run something like: cc-switch --app codex deeplink "ccswitch://v1/import?resource=provider&app=claude..."we should fail fast with a clear message, for example: That keeps the protocol reproducible for scripts/geeks, and avoids surprising behavior for beginners. |
|
@SaladDay Thanks for your suggestion! I agree on it. I'll get this implemented as soon as possible. |
|
Wowwww!! Thanks you for your contribution!! |
|
I have fully replicated the cc-switch behavior for handling deeplinks. This command enables CLI-based deeplink imports. Since it reuses utils.rs, prompt.rs, etc., pulled directly from cc-switch, it shares the exact same Base64 decoding logic—meaning the issue with While I believe we could allow deeplinks to directly trigger the TUI interface in the future, that is out of scope for this PR. This is now ready for review! |
Summary
cc-switch deeplink <url>command that dispatches byresourcetype (provider/mcp/prompt/skill), with the deep link's ownapp/appsparameters driving the target.Test plan
cargo test deeplinkpasses all integration testscargo fmt --checkandcargo clippyclean