vde-open 0.0.0-stage → 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yuki Yano
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 CHANGED
@@ -1,3 +1,141 @@
1
- # Temporary Holding Version
1
+ # vde-open
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [日本語](README.ja.md)
4
+
5
+ A local document viewer for agents and people who work from the same material. Open Markdown and HTML documents, read them in a management UI in the browser, and let an agent search and read the same documents from the CLI. An agent can also ask a person questions, and the person submits the answers from the management UI.
6
+
7
+ - Agents can search and read only the documents you opened (closed documents and whole directories are never searched).
8
+ - When you save a document, the management UI updates automatically.
9
+ - HTML is shown on a separate origin from the management UI, without running scripts (by default).
10
+ - The state is kept by a local daemon and is never sent to an external service.
11
+
12
+ ## Install
13
+
14
+ Node.js 24 or later is required (this repository pins 24.21.0 in `mise.toml`).
15
+
16
+ ```bash
17
+ pnpm install --frozen-lockfile
18
+ pnpm build
19
+ pnpm test:pack # builds artifacts/vde-open-0.1.0.tgz and verifies an install in a separate directory
20
+ bun add -g ./artifacts/vde-open-0.1.0.tgz # recommended: user-level install into ~/.bun/bin
21
+ ```
22
+
23
+ - We recommend installing it once per user with Bun. `~/.bun/bin` does not depend on which Node.js version is active, so switching Node.js versions (with mise and similar tools) does not remove `vo`. Bun is only used to install; the commands run on Node.js (`#!/usr/bin/env node`), so Node.js 24 or later must be on your `PATH`. Running it on the Bun runtime (`bun --bun`) is not tested.
24
+ - `npm install -g ./artifacts/vde-open-0.1.0.tgz` also works, but it installs into the prefix of the active Node.js version.
25
+ - Installing it per project is not recommended. There is one daemon per user, so different versions in different projects would talk to the same daemon.
26
+ - Always start the path with `./`. Without it, the path is treated as a GitHub repository name.
27
+
28
+ Installing does not change shell files such as `.zshrc`, and runs no build or install scripts (the tarball bundles every dependency). The package is not published to npm.
29
+
30
+ ## `vde-open` and `vo`
31
+
32
+ The same CLI is installed under two names. Both use the same state and daemon.
33
+
34
+ - `vde-open`: the full name.
35
+ - `vo`: the short name.
36
+
37
+ If you already have a different `vo` (another tool's command, an alias, and so on), installing never overwrites or deletes it.
38
+
39
+ - If the install target's bin directory (for `npm install -g`, npm's global bin) already has another `vo` file, npm stops with `EEXIST`. Do not use `--force`; it replaces the existing `vo`. Install with Bun instead, or into another prefix (for example `npm install -g --prefix ~/.local/vde-open ./artifacts/vde-open-0.1.0.tgz`) and use `vde-open` from that bin directory.
40
+ - For a `vo` or alias elsewhere, whichever comes first on `PATH` runs. In that case, use `vde-open`. If you want a short name, define an alias in your shell (for example `alias vdo=vde-open`).
41
+
42
+ ## Basic usage
43
+
44
+ ```bash
45
+ vo open README.md docs/design.md # open documents (starts the daemon if needed)
46
+ vo open docs -w # open a directory and follow new documents
47
+ vo ui # open the management UI (one-time URL)
48
+ vo list --json # list open documents
49
+ vo search "認証の設計" --json # search open documents
50
+ vo read <documentId> --section sec_0003 --json # read a section
51
+ vo close docs/design.md # remove from the list (the file is not deleted)
52
+ vo daemon stop # stop the daemon
53
+ ```
54
+
55
+ How agents should use it is described in [docs/agent-usage.md](docs/agent-usage.md): read in the order search, outline, then sections; ask questions and get answers; receive draft answers from HTML.
56
+
57
+ ## Agent skill
58
+
59
+ [`skills/vde-open/SKILL.md`](skills/vde-open/SKILL.md) is a skill that teaches an agent (Claude Code, Codex, and others that read `SKILL.md`) when and how to use `vo`. It is also included in the package. To use it, link or copy the directory into your agent's skill directory:
60
+
61
+ ```bash
62
+ ln -s "$PWD/skills/vde-open" ~/.claude/skills/vde-open # Claude Code
63
+ ln -s "$PWD/skills/vde-open" ~/.codex/skills/vde-open # Codex
64
+ ```
65
+
66
+ ## Search scope
67
+
68
+ - Search covers **only the documents that are open right now**. Closed documents, files that are not open, and whole directories are never searched.
69
+ - Results come from the revision that was published when you searched. Reading with the `revision` from a result returns the same content that was searched.
70
+ - Japanese text is split into words with `Intl.Segmenter`. Search uses exact matches, prefix matches, and fuzzy matches of alphanumeric words with up to one character of difference.
71
+ - In the management UI, press `Cmd/Ctrl+K` to search.
72
+
73
+ ## HTML display limits
74
+
75
+ - By default (static), scripts do not run. Scripts, event attributes, iframe/object/embed, base, automatic navigation (meta refresh), form targets, and external images, CSS, and fonts are removed. Links cannot be clicked inside the view; open them from "Links in this document".
76
+ - Only files that the document references, inside the assets root (by default the document's directory), can be loaded. Files whose names start with "." such as `.env` and `.git` are never loaded. Set the scope with `--assets-root` and individual files with `--asset`.
77
+ - Scripts run only in HTML opened with `--html-mode interactive`. Scripts can load only registered files and cannot reach the management UI, the management API, or other files. This does not block every outbound request, including navigation inside the view. Use it only with HTML that you or the agent prepared and trust. After the daemon restarts, the HTML shows as a static view until you allow scripts again in the management UI.
78
+ - Differences between the original document and the view are listed under "Differences from the original document" in the management UI, with what is affected, why, and what to do.
79
+
80
+ ## Markdown display limits
81
+
82
+ Markdown is rendered with TanStack Markdown 1.0.0. It is not fully compatible with CommonMark or GFM.
83
+
84
+ - Raw HTML is not rendered; it is shown as text.
85
+ - External images are not loaded. Only images under the document's directory are shown.
86
+ - Code is highlighted only for JS, JSX, TS, TSX, JSON, YAML, HTML, CSS, Bash, and Markdown. Code larger than 256 KiB and other languages are not highlighted.
87
+ - Documents that cannot be parsed within 2 seconds, or that have more than 100,000 elements or more than 64 levels of nesting, are shown as source.
88
+
89
+ ## Where the state is stored, and stopping
90
+
91
+ - The state (open documents, revisions, questions and answers) is stored here. Change it with `VDE_OPEN_HOME`.
92
+ - macOS: `~/Library/Application Support/vde-open`
93
+ - Linux: `$XDG_STATE_HOME/vde-open` (or `~/.local/state/vde-open` if unset)
94
+ - Windows: `%LOCALAPPDATA%\vde-open`
95
+ - Stop the daemon with `vo daemon stop`. It stops the daemon no matter which name started it. Check its status with `vo daemon status`.
96
+ - Management UI preferences such as the color theme and the view mode are stored in the browser. The open documents follow the daemon's state.
97
+
98
+ ## Asking a person and getting answers
99
+
100
+ ```bash
101
+ vo ask questions.json --view review.md --json # open a document and ask about it
102
+ vo feedback wait <requestId> --timeout 120 --json
103
+ vo feedback ack <requestId> --submission-id <id> --json
104
+ ```
105
+
106
+ The person answers in the answer panel of the management UI. The answers are submitted only when they press "Send answers to the agent". Input before submission (the draft answer) is never returned to the agent. Do not use this to collect secrets such as passwords or API keys.
107
+
108
+ ## Troubleshooting
109
+
110
+ | Symptom | What to do |
111
+ |---|---|
112
+ | `vo` runs a different command | Use `vde-open`, or check the order of `PATH` |
113
+ | The management UI asks you to open it again from the CLI | Open a new URL with `vo ui` (each URL works once; after the daemon restarts, earlier windows stop working) |
114
+ | Exit code 8 (cannot connect to or start the daemon) | Check with `vo daemon status`, and look for leftover files with `vo doctor` |
115
+ | Images or CSS are not shown | Open "Differences from the original document" and register them with `--assets-root` or `--asset` |
116
+ | Search does not find a document | Check with `vo list --json` that the document is open and its `searchState` is `ready` |
117
+
118
+ ## Verified scope
119
+
120
+ | Scope | Status |
121
+ |---|---|
122
+ | macOS (Darwin 25.6.0, arm64), Node.js 24.21.0, locally | Verified (format, lint, typecheck, unit/integration, build, pack, e2e) |
123
+ | Linux and macOS on CI (GitHub Actions `ubuntu-latest` and `macos-latest`, Node.js 24.21.0) | Verified (format, lint, typecheck, unit/integration, build, pack, and e2e in Chromium, Firefox, and WebKit; `.github/workflows/ci.yml`) |
124
+ | Windows on CI (`windows-latest`, Node.js 24.21.0) | Verified: build, pack smoke (install, both bins, IPC, starting and stopping the daemon, JSON output, the UI and workers), and the daemon and document integration tests. The other unit and integration tests and the e2e tests are not run on Windows |
125
+ | Browsers (macOS) | Chromium (Playwright's Chrome Headless Shell): the full suite is verified. Firefox 155 and WebKit 26.6 (Playwright 1.63.0): the view isolation, CSP, HTML bridge, and authentication tests (`pnpm test:e2e:cross`) are verified |
126
+ | Browsers (not verified) | Other UI interactions in Firefox and WebKit (search, answer panel, narrow screens, a list of 1,000 documents) are not verified |
127
+ | Markdown syntax | As described in "Markdown display limits" above. Full CommonMark and GFM are not verified |
128
+
129
+ More details: [docs/performance.md](docs/performance.md) (measurements), [docs/architecture.md](docs/architecture.md) and [docs/security-model.md](docs/security-model.md) (design). Development records (in Japanese): [docs/implementation-status.md](docs/implementation-status.md), [docs/dependency-validation.md](docs/dependency-validation.md), and [docs/adr/](docs/adr/).
130
+
131
+ ## Releasing
132
+
133
+ Releases are published to npm by GitHub Actions with trusted publishing (OIDC), so no npm token is stored anywhere. The trusted publisher on npmjs.com is set to this repository and the workflow file `publish.yml`, and publishing with tokens is disallowed.
134
+
135
+ 1. Update `version` in `apps/cli/package.json` and commit it to `main`.
136
+ 2. Push a tag for that version: `git tag v0.1.0 && git push origin v0.1.0`.
137
+ 3. `.github/workflows/publish.yml` checks that the tag matches the version, runs the checks and the pack smoke test, and publishes the tarball with provenance.
138
+
139
+ ## License
140
+
141
+ [MIT](LICENSE). Bundled dependencies keep their own licenses. Their list and license texts are in `THIRD_PARTY_NOTICES.md` in the package (generated by `pnpm build` from what was bundled).