Inventory of the 29 core plugins (22 done, 2 partial, 5 missing), 80 community plugins with a verdict each, a ranked roadmap with 8 ready briefs, the Bases spec (D1-D13) and 20 tasks, ASCII wireframes of the Bases screens (PaperCraft was not running). crates/bases is registered at layer L2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2.6 KiB
TASK uri-open: parse notescraft:// links and the uri.resolve command (Advanced URI)
Runs through OpenCode (specs/agents/opencode-runbook.md is attached automatically).
OWNS
crates/engine/src/uri/mod.rs,crates/engine/src/uri/parse.rs,crates/engine/src/uri/commands.rs(new folder), onemod uri;line incrates/engine/src/lib.rs, oneregister_uri(reg)call incrates/engine/src/commands.rs::register_corecrates/engine/src/ai/assistant_gate.rs(READ list),crates/engine/tests/core_commands.rs(CORE_IDS),crates/engine/tests/uri.rs
FILES TO OPEN
- pattern:
crates/engine/src/builtin/bookmark_commands.rs;crates/engine/src/vault/external.rs(how paths are validated against the vault) crates/engine/src/vaults/orvaults.listhandler incrates/engine/src/commands.rs(vault names) for thevaultfieldcrates/ui-egui/src/shell/app/window/menus.rs("Copy Obsidian URL" shows the existing URL shape)
GOAL / API
Grammar: notescraft://open?vault=<name>&file=<path>[&heading=<h>][&block=<id>][&line=<n>], notescraft://new?vault=&name=<path>&content=<text> (content at most 8 KiB), notescraft://daily?vault=, notescraft://search?vault=&query=. Percent-decoding by hand (UTF-8, + is not a space); no dependency.
parse(&str) -> Result<UriAction>withUriAction { Open{vault, file, heading, block, line}, New{..}, Daily{..}, Search{..} }.uri.resolve {url}(read-only) ->{action, vault, path, exists}; it never executes anything.newreturnsneeds_confirmation: trueso the UI asks before creating a note (an external link must not write silently).- Hostile input: path traversal (
.., absolute,.obsidian/,.notescraft/) ->invalid_params; control characters; URL over 4 KiB; unknown action ->invalid_params. notescraft://commandis NOT supported (security): documented in rustdoc.
TESTS
crates/engine/tests/uri.rs: every action, percent-encoded UTF-8, .. refused, .notescraft/x refused, 5 KiB URL refused, unknown vault not_found, new flagged for confirmation, round trip with a format_open_uri(vault, file, heading) helper the UI will use for "Copy NotesCraft URL".
VERIFY
export PATH="$HOME/.cargo/bin:$PATH"
cargo test -p notescraft-engine --test uri
cargo test -p notescraft-engine --test core_commands
cargo clippy -p notescraft-engine --all-targets -- -D warnings
rustfmt --edition 2024 crates/engine/src/uri/*.rs crates/engine/tests/uri.rs
DO NOT
Register an OS URL scheme handler (apps/notescraft packaging is a follow-up for the lead); execute commands from a URL; touch apps/.