obsidian-catui-acp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/THIRD_PARTY_NOTICES.txt +3002 -0
- package/esbuild.config.mjs +29 -0
- package/main.js +3499 -0
- package/manifest.json +9 -0
- package/package.json +57 -0
- package/src/acp/catui-client.ts +108 -0
- package/src/acp/catui-process.ts +49 -0
- package/src/acp/ndjson-rpc.ts +142 -0
- package/src/acp/types.ts +101 -0
- package/src/chat/acp-chat-transport.ts +28 -0
- package/src/chat/session-messages-cache.ts +40 -0
- package/src/context/vault-context.ts +35 -0
- package/src/main.ts +529 -0
- package/src/policy/permission-policy.ts +52 -0
- package/src/react/ChatApp.tsx +677 -0
- package/src/settings.ts +124 -0
- package/src/styles.css +270 -0
- package/src/ui/chat-view.tsx +38 -0
- package/styles.css +2 -0
- package/test/catui-client.test.ts +61 -0
- package/test/ndjson-rpc.test.ts +74 -0
- package/test/permission-policy.test.ts +31 -0
- package/test/session-messages-cache.test.ts +59 -0
- package/test/vault-context.test.ts +44 -0
- package/tsconfig.json +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cunyu666
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# CatUI ACP for Obsidian
|
|
2
|
+
|
|
3
|
+
Desktop plugin with compiled files and TypeScript/React source for chatting with a local CatUI agent through ACP. Includes streaming responses, tool activity, session controls, active note context, permission review, and diagnostics.
|
|
4
|
+
|
|
5
|
+
## Install from npm
|
|
6
|
+
|
|
7
|
+
This package is a distribution of an Obsidian plugin, not a Node.js library. Installing it with npm alone does not enable it in Obsidian.
|
|
8
|
+
|
|
9
|
+
Download it from the public npm registry:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm pack obsidian-catui-acp@0.1.0 --registry=https://registry.npmjs.org/
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Extract the archive and copy **main.js**, **manifest.json**, and **styles.css** from its `package/` folder into `<your-vault>/.obsidian/plugins/catui-acp/`. Reload Obsidian and enable **CatUI ACP** under Community plugins. This package has no npm runtime dependencies and no automatic installation scripts.
|
|
16
|
+
|
|
17
|
+
Alternatively, `npm install obsidian-catui-acp --registry=https://registry.npmjs.org/` downloads the same files to `node_modules/obsidian-catui-acp/`; copy the same three files from there.
|
|
18
|
+
|
|
19
|
+
## Set up CatUI
|
|
20
|
+
|
|
21
|
+
Install [CatUI](https://github.com/O-Pencil/Catui) separately with `npm install -g catui-agent --registry=https://registry.npmjs.org/` (Node.js 20+). Run `catui` to configure your model provider and credentials. In Obsidian plugin settings, set the command to `catui` (or its full executable path) and arguments to `--acp`. The executable and Node.js must be accessible to Obsidian's environment. The plugin does not install or update CatUI.
|
|
22
|
+
|
|
23
|
+
Requires Obsidian desktop; mobile is unsupported. The manifest declares Obsidian 1.5.0 as its minimum, but cross-version and Windows compatibility have not been independently verified for this distribution.
|
|
24
|
+
|
|
25
|
+
## Vault behavior
|
|
26
|
+
|
|
27
|
+
This is the author's current **LLM-Wiki-oriented version**, not the unfinished generic release candidate. It adds instructions that `raw/` is immutable, `wiki/` is agent-maintained, `wiki/log.md` is append-only, and that the agent should follow the vault's AGENTS.md and LLM-Wiki skill. Raw-path permission filtering is enabled by default and can be disabled in settings. These instructions and permission filters are not a filesystem sandbox.
|
|
28
|
+
|
|
29
|
+
## Privacy and permissions
|
|
30
|
+
|
|
31
|
+
Prompts, the optional active note path, and selected text are sent to a local CatUI process over stdin/stdout. CatUI may read more files and send their contents and tool results to your configured model provider, such as OpenAI, Anthropic, Google, Alibaba DashScope, or local Ollama. Remote providers supply model inference and may require an account, API key, and payment; consult their data policies. The plugin itself has no subscription and stores no provider API keys.
|
|
32
|
+
|
|
33
|
+
CatUI can access files outside the vault, including configuration, credentials, sessions, and memory under its home configuration directory. It runs with your OS permissions. Ask mode requests review for agent operations; bypass mode may execute without review. The raw-path filter only handles requests the agent actually sends to the plugin and does not guarantee protection against every tool or path.
|
|
34
|
+
|
|
35
|
+
The plugin adds no telemetry; CatUI, extensions, and providers have their own policies. Markdown images can contact their hosts, and clicked links open external websites. Diagnostics may contain file paths or agent output. Personal plugin configuration is not included in this package.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
Plugin code: MIT. Bundled third-party notices are in `THIRD_PARTY_NOTICES.txt` and embedded in `main.js`. CatUI is separately distributed under GPL-3.0 and is not included. This is a community plugin, not an official Obsidian product.
|
|
40
|
+
|
|
41
|
+
## Build from source
|
|
42
|
+
|
|
43
|
+
Source, tests, and build configuration are included. After extracting the npm archive, enter its `package` directory and run:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npm install --include=dev --registry=https://registry.npmjs.org/
|
|
47
|
+
npm run typecheck
|
|
48
|
+
npm test
|
|
49
|
+
npm run build
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
All build dependencies are development dependencies, so users downloading the plugin with `npm install obsidian-catui-acp` do not install the development toolchain. npm may omit `package-lock.json` from published packages; use the declared dependency ranges when building from the npm archive.
|