feat(commands): /link and /attach structured stash#138
Closed
BunsDev wants to merge 1 commit into
Closed
Conversation
Adds a personal local stash for links and file attachments backed by ~/.coven-code/stash.sqlite. /link saves URLs with title/note/tags and project/session metadata; /attach copies files into ~/.coven-code/attachments/<id>/ so the stored copy survives moves and deletions. Both support add/list/search/remove (plus /attach show), tag and project filtering, and refuse to operate in hosted review mode since the stash is a personal store. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new “structured stash” feature to Coven Code, backing the new /link and /attach slash commands with a durable local SQLite store and wiring the commands into the commands registry, TUI palette, and user docs.
Changes:
- Introduces
claurst_core::stash(StashStore) for persistent storage of links and attachment metadata, plus copying attachments into~/.coven-code/attachments/. - Adds
/linkand/attachcommands (argument parsing, hosted-review refusal, formatting, and tests) and registers them in the commands registry. - Updates the TUI slash-command palette entries and documents the new commands in
docs/commands.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src-rust/crates/tui/src/app.rs | Adds /attach and /link to the slash-command palette/autocomplete list. |
| src-rust/crates/core/src/stash.rs | New SQLite-backed stash implementation for links and attachments (plus unit tests). |
| src-rust/crates/core/src/lib.rs | Exposes the new stash module from claurst_core. |
| src-rust/crates/commands/src/lib.rs | Implements /link + /attach, argument parsing helpers, hosted-review refusal, formatting, registration, and tests. |
| docs/commands.md | Documents /link and /attach under “Search & Files”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10209
to
+10221
| for token in args.split_whitespace() { | ||
| if let Some(name) = token.strip_prefix("--") { | ||
| if let Some(flag) = current_flag.take() { | ||
| flags.insert(flag, current_value.join(" ")); | ||
| current_value.clear(); | ||
| } | ||
| current_flag = Some(name.to_string()); | ||
| } else if current_flag.is_some() { | ||
| current_value.push(token.to_string()); | ||
| } else { | ||
| positional.push(token.to_string()); | ||
| } | ||
| } |
| .file_name() | ||
| .map(|f| f.to_string_lossy().to_string()) | ||
| .unwrap_or_else(|| "attachment".to_string()); | ||
| let dest_dir = attachments_dir.join(&id[..8]); |
Comment on lines
+326
to
+330
| let stored = Path::new(&item.value); | ||
| let _ = std::fs::remove_file(stored); | ||
| if let Some(dir) = stored.parent() { | ||
| let _ = std::fs::remove_dir(dir); | ||
| } |
| /link remove <id> — delete a link | ||
| ``` | ||
|
|
||
| `/link list` shows each entry's short id, save date, title, URL, and tags. `--project` limits the listing to links saved from the current repository. The stash is a personal local store and is disabled in [hosted review mode](configuration#hosted-review-mode). |
Member
Author
|
Superseded by #135, which merged the same /link and /attach stash feature (main's version also adds quoted-path support). Closing. |
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
/linkand/attach— a structured, personal, local stash for URLs and file attachments.Context
crates/core/src/stash.rs(SQLite-backed store),crates/commands(LinkCommand,AttachCommand, arg parsing, registration, tests), palette entries incrates/tui/src/app.rs, anddocs/commands.md.Changes
claurst_core::stash:StashStoreover~/.coven-code/stash.sqlitewith links and attachments, tags, project/session metadata, search, and removal; attachments are copied into~/.coven-code/attachments/<id>/so the stored copy survives source moves/deletions./link <url> | add | list [--tag|--project] | search | removeand/attach <path> | add | list | search | show | remove, with--title/--note/--tagsflags.attach/link; registry-coverage test passes.docs/commands.mddocuments both commands under Search & Files.Validation
Record exact commands and outcomes. Mark items N/A with a reason when they do not apply.
git diff --check— clean.cargo fmt --all— clean.cargo check --workspace— passed.cargo clippy --workspace --all-targets -- -D warnings— passed.cargo test -p claurst-core stash(5 passed),cargo test -p claurst-commands stash(3 passed),cargo test -p claurst-commands refuses_hosted(2 passed),cargo test -p claurst-commands prompt_slash(registry coverage, 1 passed).cargo test --workspace— additive feature; all touched crates' relevant suites plus workspace check/clippy cover it.PR Readiness