vde-open 0.1.0 → 0.1.2
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/README.md +40 -11
- package/dist/cli.js +2 -2
- package/dist/daemon.js +2 -2
- package/dist/{heap-Dev_gSQn.js → heap-C3qHm7SE.js} +9 -4
- package/dist/{main-lxBamyBU.js → main-CqENdUsw.js} +832 -59
- package/dist/{render-yCayIbhf.js → render-BNZz0CjQ.js} +101 -9
- package/dist/{search-index-C0szMSlZ.js → search-index-__laOomT.js} +70 -5
- package/dist/web/assets/index-CC0ZOdtr.css +2 -0
- package/dist/web/assets/index-DsIZiz-K.js +97 -0
- package/dist/web/index.html +2 -2
- package/dist/workers/parse-worker.js +6 -2
- package/dist/workers/search-worker.js +8 -5
- package/docs/agent-usage.md +11 -0
- package/package.json +1 -1
- package/skills/vde-open/SKILL.md +2 -2
- package/dist/web/assets/index-BYu5_12H.css +0 -2
- package/dist/web/assets/index-CLggJFeG.js +0 -95
package/README.md
CHANGED
|
@@ -11,21 +11,47 @@ A local document viewer for agents and people who work from the same material. O
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
Node.js 24 or later is required
|
|
14
|
+
Node.js 24 or later is required.
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
17
|
+
bun add -g vde-open # recommended: user-level install into ~/.bun/bin
|
|
18
|
+
npm install -g vde-open # also works
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
- 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
|
|
22
|
+
- `npm install -g` installs into the prefix of the active Node.js version.
|
|
25
23
|
- 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
24
|
|
|
28
|
-
Installing does not change shell files such as `.zshrc`, and runs no build or install scripts (the
|
|
25
|
+
Installing does not change shell files such as `.zshrc`, and runs no build or install scripts (the package bundles every dependency). Releases are published from GitHub Actions with provenance (see "Releasing").
|
|
26
|
+
|
|
27
|
+
To install from a clone of this repository (pins Node.js 24.21.0 in `mise.toml`):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm install --frozen-lockfile
|
|
31
|
+
pnpm build
|
|
32
|
+
pnpm test:pack # builds artifacts/vde-open-<version>.tgz and verifies an install in a separate directory
|
|
33
|
+
bun add -g "$PWD/artifacts/vde-open-0.1.2.tgz" # use an absolute path: bun add -g resolves relative paths from its global install directory, not the current one
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Developing with a linked CLI
|
|
37
|
+
|
|
38
|
+
From the repository root, build once and link the CLI package globally:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm install --frozen-lockfile
|
|
42
|
+
pnpm build
|
|
43
|
+
cd apps/cli
|
|
44
|
+
bun link
|
|
45
|
+
bun link -g vde-open
|
|
46
|
+
cd ../..
|
|
47
|
+
pnpm build:watch
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`build:watch` builds immediately, then watches the CLI, UI, shared sources, build configuration, and packaged files. Saves are coalesced and builds run one at a time. Both apps and the package files are prepared in a temporary directory before replacing the distribution; a failed build leaves the last successful output in place. The next linked CLI invocation uses the updated build.
|
|
51
|
+
|
|
52
|
+
The watcher does not start or restart your daemon. After a successful build, run `vo daemon restart`, then `vo ui` to open the updated UI. Restarting preserves registered documents and saved answers, but changes the UI address and invalidates earlier browser sessions and interactive HTML permissions. Stop the watcher with Ctrl+C; it stops an active build and removes its temporary output.
|
|
53
|
+
|
|
54
|
+
For frequent UI changes, use `pnpm dev` instead. It runs the source daemon with a separate `.dev-home` and serves the UI through Vite HMR. It does not rebuild the linked CLI or automatically restart the backend when its source changes. CLI commands for that environment need the same absolute `VDE_OPEN_HOME` (for example, `VDE_OPEN_HOME="$PWD/.dev-home" vo list` from the repository root).
|
|
29
55
|
|
|
30
56
|
## `vde-open` and `vo`
|
|
31
57
|
|
|
@@ -36,7 +62,7 @@ The same CLI is installed under two names. Both use the same state and daemon.
|
|
|
36
62
|
|
|
37
63
|
If you already have a different `vo` (another tool's command, an alias, and so on), installing never overwrites or deletes it.
|
|
38
64
|
|
|
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.
|
|
65
|
+
- 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.2.tgz`) and use `vde-open` from that bin directory.
|
|
40
66
|
- 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
67
|
|
|
42
68
|
## Basic usage
|
|
@@ -59,8 +85,11 @@ How agents should use it is described in [docs/agent-usage.md](docs/agent-usage.
|
|
|
59
85
|
[`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
86
|
|
|
61
87
|
```bash
|
|
62
|
-
|
|
63
|
-
ln -s
|
|
88
|
+
# Installed with Bun: the skill is in the global package directory.
|
|
89
|
+
ln -s ~/.bun/install/global/node_modules/vde-open/skills/vde-open ~/.claude/skills/vde-open # Claude Code
|
|
90
|
+
ln -s ~/.bun/install/global/node_modules/vde-open/skills/vde-open ~/.codex/skills/vde-open # Codex
|
|
91
|
+
# Installed with npm: use "$(npm root -g)/vde-open/skills/vde-open" instead.
|
|
92
|
+
# From a clone of this repository: use "$PWD/skills/vde-open".
|
|
64
93
|
```
|
|
65
94
|
|
|
66
95
|
## Search scope
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as decodeStateFile, D as daemonEntryPath, E as resolveStateRoot, O as referencedBlobs, S as renameWithRetry, T as resolveRuntimeLocation, a as DAEMON_LOCK_NAME, b as proofMatches, c as readIpcKey, d as inspectOwner, f as readCurrentLock, g as encodeFrame, h as FrameDecoder, i as requirePrivateDirectoryIfExists, k as version, l as readPointer, m as systemProcessProbe, n as ensurePrivateDirectory, o as POINTER_FILE, p as releaseLock, r as inspectPrivateDirectory, s as START_LOCK_NAME, t as startDaemon, u as acquireLock, v as computeProof, w as currentPathEnvironment, x as removeWithRetry, y as createNonce } from "./main-
|
|
3
|
-
import { A as successEnvelope, C as VdeError, D as ExitCode, E as isVdeError, O as envelopeSchema, T as isErrorCode, Y as LIMITS, k as errorEnvelope, w as exitCodeForError } from "./search-index-
|
|
2
|
+
import { C as decodeStateFile, D as daemonEntryPath, E as resolveStateRoot, O as referencedBlobs, S as renameWithRetry, T as resolveRuntimeLocation, a as DAEMON_LOCK_NAME, b as proofMatches, c as readIpcKey, d as inspectOwner, f as readCurrentLock, g as encodeFrame, h as FrameDecoder, i as requirePrivateDirectoryIfExists, k as version, l as readPointer, m as systemProcessProbe, n as ensurePrivateDirectory, o as POINTER_FILE, p as releaseLock, r as inspectPrivateDirectory, s as START_LOCK_NAME, t as startDaemon, u as acquireLock, v as computeProof, w as currentPathEnvironment, x as removeWithRetry, y as createNonce } from "./main-CqENdUsw.js";
|
|
3
|
+
import { A as successEnvelope, C as VdeError, D as ExitCode, E as isVdeError, O as envelopeSchema, T as isErrorCode, Y as LIMITS, k as errorEnvelope, w as exitCodeForError } from "./search-index-__laOomT.js";
|
|
4
4
|
import fs, { fstatSync } from "node:fs";
|
|
5
5
|
import { lstat, readFile, readdir, stat as stat$1, writeFile } from "node:fs/promises";
|
|
6
6
|
import path, { join, resolve } from "node:path";
|
package/dist/daemon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as version, t as startDaemon, w as currentPathEnvironment } from "./main-
|
|
2
|
-
import { E as isVdeError } from "./search-index-
|
|
1
|
+
import { k as version, t as startDaemon, w as currentPathEnvironment } from "./main-CqENdUsw.js";
|
|
2
|
+
import { E as isVdeError } from "./search-index-__laOomT.js";
|
|
3
3
|
//#region src/daemon.ts
|
|
4
4
|
function notifyParent(message) {
|
|
5
5
|
if (!process.send) return;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { getHeapStatistics, setFlagsFromString } from "node:v8";
|
|
2
2
|
import { runInNewContext } from "node:vm";
|
|
3
3
|
//#region src/diagnostics/heap.ts
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
let gc = null;
|
|
5
|
+
function collectGarbage() {
|
|
6
|
+
if (gc === null) {
|
|
6
7
|
setFlagsFromString("--expose-gc");
|
|
7
|
-
runInNewContext("gc")
|
|
8
|
+
gc = runInNewContext("gc");
|
|
8
9
|
}
|
|
10
|
+
gc();
|
|
11
|
+
}
|
|
12
|
+
function measureHeap(collect) {
|
|
13
|
+
if (collect) collectGarbage();
|
|
9
14
|
return getHeapStatistics().used_heap_size;
|
|
10
15
|
}
|
|
11
16
|
//#endregion
|
|
12
|
-
export { measureHeap as t };
|
|
17
|
+
export { measureHeap as n, collectGarbage as t };
|