threadshelf 1.2.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/CHANGELOG.md +185 -0
- package/LICENSE +21 -0
- package/README.md +763 -0
- package/SECURITY.md +75 -0
- package/bin/threadshelf-mcp.js +12 -0
- package/bin/threadshelf.js +87 -0
- package/dist/mcp/server.js +388 -0
- package/dist/src/chunking.js +72 -0
- package/dist/src/cli.js +24 -0
- package/dist/src/embedding.js +59 -0
- package/dist/src/env.js +2 -0
- package/dist/src/generation/config.js +344 -0
- package/dist/src/generation/downloader.js +172 -0
- package/dist/src/generation/error-log.js +34 -0
- package/dist/src/generation/filesystem-browser.js +83 -0
- package/dist/src/generation/gguf-metadata.js +179 -0
- package/dist/src/generation/hardware.js +87 -0
- package/dist/src/generation/llama-install.js +563 -0
- package/dist/src/generation/llama-process.js +576 -0
- package/dist/src/generation/llama-profile.js +136 -0
- package/dist/src/generation/master-prompts.js +155 -0
- package/dist/src/generation/model-catalog.js +276 -0
- package/dist/src/generation/model-discovery.js +60 -0
- package/dist/src/generation/model-download.js +151 -0
- package/dist/src/generation/openai-compatible.js +231 -0
- package/dist/src/generation/providers/llama-cpp.js +97 -0
- package/dist/src/generation/providers/openrouter.js +106 -0
- package/dist/src/generation/quick-setup.js +215 -0
- package/dist/src/generation/registry.js +23 -0
- package/dist/src/generation/service.js +100 -0
- package/dist/src/generation/threads.js +311 -0
- package/dist/src/generation/types.js +1 -0
- package/dist/src/ingest-cli.js +95 -0
- package/dist/src/ingest.js +257 -0
- package/dist/src/load-env.js +17 -0
- package/dist/src/model-label.js +15 -0
- package/dist/src/parser.js +811 -0
- package/dist/src/paths.js +79 -0
- package/dist/src/routes/collections.js +97 -0
- package/dist/src/routes/files.js +136 -0
- package/dist/src/routes/generation.js +536 -0
- package/dist/src/routes/health.js +6 -0
- package/dist/src/routes/index.js +21 -0
- package/dist/src/routes/ingest.js +300 -0
- package/dist/src/routes/insights.js +24 -0
- package/dist/src/routes/loopback.js +15 -0
- package/dist/src/routes/model-catalog.js +178 -0
- package/dist/src/routes/search.js +57 -0
- package/dist/src/routes/stream-abort.js +23 -0
- package/dist/src/routes/thread.js +43 -0
- package/dist/src/search-cli.js +93 -0
- package/dist/src/server.js +78 -0
- package/dist/src/services/collections.js +58 -0
- package/dist/src/services/insights.js +111 -0
- package/dist/src/services/search.js +68 -0
- package/dist/src/services/stats.js +35 -0
- package/dist/src/services/thread.js +140 -0
- package/dist/src/store.js +1138 -0
- package/dist/src/validation.js +250 -0
- package/dist/src/watch.js +83 -0
- package/package.json +103 -0
- package/public/assets/index-CIm_Idqi.js +38 -0
- package/public/assets/index-Dv09K2vS.css +1 -0
- package/public/favicon.svg +6 -0
- package/public/index.html +28 -0
- package/scripts/openrouter-export-all.js +228 -0
- package/scripts/openrouter-export-browser.js +153 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ThreadShelf are documented here.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Install with `npx threadshelf`
|
|
8
|
+
|
|
9
|
+
- Publish ThreadShelf to npm as the unscoped `threadshelf` package, with the
|
|
10
|
+
prebuilt web UI included. `npx threadshelf` downloads, starts and serves on
|
|
11
|
+
<http://localhost:3000> with no clone and no build step.
|
|
12
|
+
- Add the `threadshelf` and `threadshelf-mcp` executables. Both are plain
|
|
13
|
+
JavaScript and run the compiled server in `dist/`, so the published package
|
|
14
|
+
needs neither `tsx` nor `typescript` at runtime.
|
|
15
|
+
- Compile the server and MCP server to distributable JavaScript
|
|
16
|
+
(`tsconfig.build.json`), wired into `prepack` so a published tarball can never
|
|
17
|
+
contain a stale build. `files` is an allow-list: no sources, tests, docs
|
|
18
|
+
screenshots, `.env` or user data are published.
|
|
19
|
+
- Separate application files from persistent data. Package assets now resolve
|
|
20
|
+
against the installed module instead of `process.cwd()`, which was wrong for
|
|
21
|
+
any `npx` run, and persistent data moves out of the disposable install
|
|
22
|
+
directory into a per-user location: `%LOCALAPPDATA%\ThreadShelf` on Windows,
|
|
23
|
+
`~/.threadshelf` on macOS and Linux. Clearing the npm cache or upgrading no
|
|
24
|
+
longer risks the archive.
|
|
25
|
+
- Cache the downloaded embedding model with the user's data rather than inside
|
|
26
|
+
`node_modules`, so an `npx` upgrade does not re-download it.
|
|
27
|
+
- Add `THREADSHELF_DATA_DIR` / `--data-dir` to relocate everything, and
|
|
28
|
+
`--where` to print the resolved package and data directories. The existing
|
|
29
|
+
narrower overrides (`LANCEDB_PATH`, `UPLOADS_DIR`, `COLLECTIONS_PATH`,
|
|
30
|
+
`MASTER_PROMPTS_PATH`, …) continue to take precedence.
|
|
31
|
+
- A repository checkout keeps the previous repo-local layout, so development and
|
|
32
|
+
the existing test harness are unchanged.
|
|
33
|
+
- Add `npm run pack:verify`: packs the tarball, installs it into a temporary
|
|
34
|
+
directory, boots the CLI from an unrelated working directory and asserts that
|
|
35
|
+
the UI is served, data lands in the data directory, and nothing is written
|
|
36
|
+
into the package or the working directory.
|
|
37
|
+
- Add `.github/workflows/publish.yml`: tag-driven release on `v*` that runs the
|
|
38
|
+
test suite and publishes through npm Trusted Publishing (OIDC), with no npm
|
|
39
|
+
token stored in the repository.
|
|
40
|
+
|
|
41
|
+
## 1.2.0 — 2026-09-13
|
|
42
|
+
|
|
43
|
+
### Archive durability
|
|
44
|
+
|
|
45
|
+
- Replace imported and ThreadShelf-authored rows with a single LanceDB merge
|
|
46
|
+
commit instead of delete-then-add, so a failed write no longer leaves a thread
|
|
47
|
+
or collection half-deleted.
|
|
48
|
+
- Keep local continuations when an export is imported again, including branches
|
|
49
|
+
whose conversation key disappeared or was rewritten; exports that parse to zero
|
|
50
|
+
conversations are skipped and never delete archived rows.
|
|
51
|
+
- `clearFirst` stages the whole folder and its embeddings before committing. An
|
|
52
|
+
invalid or empty file, or a cancellation, keeps the old collection and reports
|
|
53
|
+
`replacementSkipped` ("Nothing was saved…") instead of an empty collection.
|
|
54
|
+
- Track pending index work durably in `__threads.indexPending`. The HTTP server,
|
|
55
|
+
the MCP server and the `ingest`/`search` CLIs recover it on start, with
|
|
56
|
+
15 s–1 h backoff, a pause after 8 failures, and quarantine of undecodable rows
|
|
57
|
+
that keeps their raw data.
|
|
58
|
+
- Embed outside the global thread-table lock and re-check the snapshot before
|
|
59
|
+
committing, so a long import no longer blocks saving a chat answer elsewhere.
|
|
60
|
+
- Rename changes only the title, and appending an answer reads the current turns
|
|
61
|
+
under the lock, so neither can overwrite the other.
|
|
62
|
+
- Open LanceDB with `readConsistencyInterval: 0`, so the server, MCP and CLIs see
|
|
63
|
+
each other's commits.
|
|
64
|
+
- Share one embedding model load between concurrent callers and log its progress
|
|
65
|
+
to stderr, keeping the MCP stdout protocol clean.
|
|
66
|
+
- Report embedding progress per batch during indexing instead of stalling at 100%.
|
|
67
|
+
|
|
68
|
+
### llama.cpp performance tuning
|
|
69
|
+
|
|
70
|
+
- New Settings for the KV cache (Quality Q8 / Memory saver Q4 / F16), MTP
|
|
71
|
+
speculative decoding (Auto draft 2 / Aggressive draft 3 / Off) and reasoning
|
|
72
|
+
effort. Each option is applied only when `llama-server --help` and the GGUF
|
|
73
|
+
header support it, and is otherwise logged as skipped with a reason.
|
|
74
|
+
- Read GGUF metadata (architecture, native context, NextN/MTP layers) with a
|
|
75
|
+
bounded, cached header parser instead of guessing from file names.
|
|
76
|
+
- Run a single server slot (`--parallel 1`) so concurrent local chats queue.
|
|
77
|
+
- Show the effective runtime profile in the llama.cpp log and the Settings
|
|
78
|
+
status badge, with skip reasons in its tooltip; warn above 64K context.
|
|
79
|
+
- `setup:llama --check` compares an installed managed build with the latest
|
|
80
|
+
stable release and prints the update command for the installed variant.
|
|
81
|
+
|
|
82
|
+
### Tests
|
|
83
|
+
|
|
84
|
+
- Archive recovery regressions (`test/archive-recovery.test.js`), a fake
|
|
85
|
+
`llama-server` E2E for launch flags, diagnostics and restart on settings
|
|
86
|
+
change, GGUF parser hardening and cache tests, `setup:llama --check` output,
|
|
87
|
+
and Playwright coverage for the tuning settings and runtime badge.
|
|
88
|
+
|
|
89
|
+
## 1.1.0 — 2026-08-22
|
|
90
|
+
|
|
91
|
+
### Guided setup and model catalog
|
|
92
|
+
|
|
93
|
+
- Resolve `llama.cpp` and a fitting GGUF model in one plan, showing every URL,
|
|
94
|
+
digest, size, and destination before a single confirmation runs it.
|
|
95
|
+
- Browse Hugging Face GGUF repositories read-only over the public API: search,
|
|
96
|
+
popularity, per-quantization sizes, shard grouping, and multimodal projectors.
|
|
97
|
+
No account or token is needed for public repositories.
|
|
98
|
+
- Judge memory fit server-side from detected VRAM/RAM, so the catalog, the setup
|
|
99
|
+
plan, and the UI agree on one fits/tight/too-large verdict per quantization.
|
|
100
|
+
- Detect gated repositories up front and mark them in the UI, reporting a missing
|
|
101
|
+
`HF_TOKEN` before a download starts rather than as a 401 midway.
|
|
102
|
+
- Download models into `downloadDirectory` (default `.threadshelf/models`,
|
|
103
|
+
override `THREADSHELF_MODELS_PATH`), always part of the searched model roots so
|
|
104
|
+
a new model appears without further configuration.
|
|
105
|
+
- Open the catalog from Settings or the chat model menu; a freshly downloaded
|
|
106
|
+
model is selected automatically.
|
|
107
|
+
|
|
108
|
+
### llama.cpp release resolution
|
|
109
|
+
|
|
110
|
+
- Follow the upstream `nightly-tag.txt` pointer to the release that actually
|
|
111
|
+
carries binaries. Upstream's move to semver releases had made every install and
|
|
112
|
+
`--check` fail with "No official binary exists in release v0.2.0".
|
|
113
|
+
- Pin an exact upstream build with `--release bNNNNN`.
|
|
114
|
+
- Sort accelerator assets by toolkit version, so `cuda-13.3` wins over
|
|
115
|
+
`cuda-12.4` instead of losing an alphabetical comparison.
|
|
116
|
+
- Raise the anonymous GitHub API rate limit with `GITHUB_TOKEN`/`GH_TOKEN`, and
|
|
117
|
+
report clearly when the limit is hit.
|
|
118
|
+
- Treat reinstalling an identical build as a no-op instead of an error.
|
|
119
|
+
|
|
120
|
+
### Downloads and consent
|
|
121
|
+
|
|
122
|
+
- Share one resumable, hash-verifying downloader between runtime archives and
|
|
123
|
+
models, computing the digest in the same pass as the write instead of reading a
|
|
124
|
+
large archive back off disk. Range-based resume, retry with backoff, and a
|
|
125
|
+
stall timeout are built in; a digest mismatch deletes the partial file so it
|
|
126
|
+
can never poison a later resume.
|
|
127
|
+
- Make Cancel actually cancel. The streamed routes now watch the response's
|
|
128
|
+
`close` as well as the request's `aborted`, so a cancelled browser fetch stops
|
|
129
|
+
the transfer instead of leaving the server downloading in the background.
|
|
130
|
+
- Keep the `.part` file of a cancelled transfer so the next attempt resumes;
|
|
131
|
+
only a genuine failure deletes it. Interrupted runtime installs resume too.
|
|
132
|
+
- Bind a setup run to the plan the user approved. Plans carry a fingerprint of
|
|
133
|
+
versions, digests, and sizes; the server re-resolves everything itself and
|
|
134
|
+
returns `409` with the replacement plan when that fingerprint moved.
|
|
135
|
+
- Report an already-installed model as reuse rather than offering it as a fresh
|
|
136
|
+
multi-gigabyte download.
|
|
137
|
+
|
|
138
|
+
### Fixes
|
|
139
|
+
|
|
140
|
+
- Restore model roots on other Windows drives: `path.relative()` between drives
|
|
141
|
+
returns an absolute path with no `..` prefix, which the containment check read
|
|
142
|
+
as nested and silently dropped.
|
|
143
|
+
- Rank automatic quantization choice by quality tier rather than size, so a
|
|
144
|
+
legacy `Q4_1` no longer beats `Q4_K_M`, and `Q8_0` is no longer misread as
|
|
145
|
+
legacy.
|
|
146
|
+
- Read the `gated` flag from expanded Hub responses; list responses omit it,
|
|
147
|
+
which would have left the gating warning permanently invisible.
|
|
148
|
+
- Match runtime data roots by glob in `.gitignore` and `check-repo-hygiene.ts`. A
|
|
149
|
+
130 MB `.threadshelf-demo/` LanceDB tree had reached the index because the rule
|
|
150
|
+
was exactly `.threadshelf/`.
|
|
151
|
+
- Point the repository, homepage, issue, and CI badge links at
|
|
152
|
+
`ChrystianSchutz/ThreadShelf`.
|
|
153
|
+
|
|
154
|
+
## 1.0.0 — 2026-07-26
|
|
155
|
+
|
|
156
|
+
Initial public release.
|
|
157
|
+
|
|
158
|
+
### Archive and search
|
|
159
|
+
|
|
160
|
+
- Normalize exports from Google AI Studio, ChatGPT/OpenAI, Claude/Anthropic,
|
|
161
|
+
OpenRouter, LM Studio, and Grok/xAI.
|
|
162
|
+
- Generate multilingual embeddings locally and store vectors plus normalized
|
|
163
|
+
thread snapshots in LanceDB.
|
|
164
|
+
- Search semantically or by exact substring, filter roles/dates/models/origin,
|
|
165
|
+
browse complete conversations, pin threads, and save searches.
|
|
166
|
+
- Ingest from the UI or CLI, including cancellable runs and watch-folder mode.
|
|
167
|
+
- Query the same local index through the HTTP API, CLI, or MCP stdio server.
|
|
168
|
+
|
|
169
|
+
### Experimental generation
|
|
170
|
+
|
|
171
|
+
- Start local chats or continue imported threads through managed, loopback-only
|
|
172
|
+
`llama.cpp` with streamed output and runtime diagnostics.
|
|
173
|
+
- Optionally use the clearly marked external OpenRouter provider with live model
|
|
174
|
+
discovery and routing controls.
|
|
175
|
+
- Persist completed chats locally by default; provide a separate tab-scoped
|
|
176
|
+
private mode and unsaved recovery cards for failed/stopped streams.
|
|
177
|
+
|
|
178
|
+
### Safety and quality
|
|
179
|
+
|
|
180
|
+
- Keep generation control, filesystem browsing, and saved-chat routes
|
|
181
|
+
loopback-only.
|
|
182
|
+
- Store OpenRouter session keys in process memory and exclude archived thinking
|
|
183
|
+
from provider context.
|
|
184
|
+
- Cover parser, API, MCP, production UI, repository hygiene, and documentation
|
|
185
|
+
links in the automated test gate.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Chrystian Schutz
|
|
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.
|