README file from
GithubCanvas ACP
Canvas ACP is an Obsidian desktop plugin for asking an ACP-compatible LLM agent a question about a canvas node.
Workflow
- Open a canvas and select a note node, text node, or group node.
- Run Ask question about canvas node from the command palette, ribbon, or a hotkey.
- A modal opens showing:
- An input field for your question.
- An editable 提示词预览 (prompt preview) so you can review and tweak the prompt before sending.
- Stats line showing upstream context size and total characters.
- An Include thinking checkbox to keep or strip
<think>blocks from the response.
- Submit and the modal closes. A new text node is created on the canvas.
- The plugin streams the agent response into the new text node. The question appears as the edge label.
Group nodes
Selecting a group node treats all contained note/text nodes as combined context. A single edge connects the group to the generated response.
Upstream context
If the selected node has incoming edges, the content of those upstream nodes is automatically included as additional context in the prompt.
Settings
Configure in Settings → Canvas ACP:
- Agent command: executable path, such as
nodeor an absolute path to an ACP agent. - Agent arguments: arguments passed to the command, such as the path to an ACP adapter.
- Generated node size: width and height for new canvas text nodes.
- System prompt: replaces the default base prompt when non-empty. Blank or whitespace-only values fall back to the default behavior.
- Debug logging: prints selection, canvas write, and ACP protocol diagnostics to the developer console.
Commands
- Ask question about canvas node: opens the question modal for the selected canvas node.
Assign a shortcut in Settings → Hotkeys.
Privacy and security
The plugin sends only the selected node content, upstream context, and your question to the ACP agent process you configure. It does not make hidden network requests or collect telemetry. Any network access depends on the configured agent.
To talk to ACP, the plugin spawns the agent command you set in settings (without a shell). That process runs with your user permissions, so only configure commands you trust. Vault access uses Obsidian APIs (vault.read, vault.modify, and related helpers), not arbitrary filesystem paths outside the vault.
Development
- Install dependencies with
npm install. - Run
npm run devto compile in watch mode. - Run
npm run buildbefore publishing. - Run
npm testto execute the test suite. - Copy
main.js,styles.css, andmanifest.jsonintoVaultFolder/.obsidian/plugins/canvas-acp/for manual testing.
Acknowledgments
- This plugin was bootstrapped from the Obsidian Sample Plugin template. Its build tooling and plugin skeleton provided the starting point.
- The idea of bringing an Agent Client Protocol (ACP) agent into Obsidian was inspired by obsidian-agent-client by RAIT-09. While the codebases are independent (this project implements ACP communication with a lightweight custom client rather than the official SDK), the conceptual proof that ACP agents can work inside Obsidian was valuable.
Release
- Run
npm run verifyfor a local test/lint pass during development. - Run
npm run release:checkbefore manual release checks; it builds, tests, lints, and validates release artifacts. - Prepare the next prerelease with
npm run prerelease. Publish it withnpm run release:prerelease. - Prepare the next stable release with
npm run release:prepare. Publish it withnpm run release:stable. - There is intentionally no
npm run releasealias, because npm would run theprereleaselifecycle hook before it. - Release scripts update
package.json,package-lock.json,manifest.json, andversions.json. - Publish scripts commit the version bump, create a semver tag without a
vprefix, pushmainplus the tag, and runnpm run verify:release -- <version>. - GitHub Actions creates the GitHub Release from the pushed tag and attaches
manifest.json,main.js, andstyles.css. CI also generates artifact attestations formain.jsandstyles.css; verify withgh attestation verify main.js -R GenoZhou/canvas-acpafter downloading a release asset.