-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Add a custom protocol launcher (toki://) so users can right-click Copy for LLM on board cards and choose Open in OpenCode.
Flow:
- Fetch existing
format-for-llmmarkdown. - Copy markdown to clipboard.
- Open
toki://open?tool=opencode&mode=clipboard&v=1&workItemId=<id>. - Local protocol handler launches a new terminal and opens OpenCode interactive with prefilled prompt from clipboard.
Agreed Product Decisions
- Scheme:
toki://(notecosearch://) - Payload transport: clipboard-based
- Card UX:
- Left click on Copy button stays unchanged (copy markdown)
- Right click on Copy button opens shadcn/radix context menu
- Context menu options (v1): OpenCode only
- OpenCode run mode: interactive TUI with prefilled prompt
- Prompt source: existing
GET /work-items/format-for-llm - Platform scope:
- Linux first
- Windows support added immediately after Linux in same initiative
- Setup UX: in-app simple guided setup with copyable commands
Scope
Frontend
- Add shadcn/radix Context Menu integration for
CopyWorkItem. - Right-click menu item:
Open in OpenCode. - Launch sequence for that action:
- fetch markdown from
formatForLlm - copy to clipboard
- navigate to
toki://...
- fetch markdown from
- Add URL builder helper for strict protocol contract:
- action:
open - allowlisted params:
tool=opencode,mode=clipboard,v=1, optionalworkItemId
- action:
- Add error toasts for:
- format fetch failure
- clipboard failure
- protocol launch fallback guidance (if setup missing)
In-app Guided Setup
Provide an in-app setup dialog with copyable command steps and validation guidance.
Linux (phase 1)
- Install/verify OpenCode CLI.
- Create local
tokihandler script. - Create
.desktopentry registeringx-scheme-handler/toki. - Run
xdg-mimeregistration command. - Provide test command (
xdg-open 'toki://open?...').
Windows (phase 2, same issue)
- Add Windows setup instructions in the same in-app wizard section.
- Register
toki://in Windows Registry. - Add local launcher script/exe entrypoint for protocol args.
- Launch terminal and run OpenCode interactive with clipboard prompt.
- Provide verification steps for protocol registration + launch.
Local Handler Behavior
- Accept URL arg and strictly parse
toki://open. - Validate allowlisted
tool/mode/v. - Read clipboard text with platform-specific fallback chain.
- Spawn a terminal emulator and run OpenCode interactive prefilled prompt.
- Fail with clear terminal-visible errors when dependencies are missing.
Acceptance Criteria
- Left-click Copy behavior remains unchanged.
- Right-click Copy opens context menu with
Open in OpenCode. - Linux setup path works end-to-end and launches OpenCode with prompt content.
- Windows setup path works end-to-end and launches OpenCode with prompt content.
- Setup dialog can be re-opened and includes copyable steps for both OSes.
- No backend API changes required for v1/v2 of this feature.
Notes
OpenCode CLI reference: https://opencode.ai/docs/cli/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels