Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2d13e1d
Single sign-on with any OpenID Connect provider (#2)
krauseerl Oct 5, 2026
35eee20
fix(health): keep scanner and Paperless-ngx details behind authentica…
krauseerl Oct 7, 2026
962044f
fix(auth): refuse a TOTP code that was already accepted (#5)
krauseerl Oct 7, 2026
c8b2ce2
fix(deps): update proxy-addr, ip-address and brace-expansion (#3)
krauseerl Oct 7, 2026
e1e16a1
fix(auth): stop POST /login from revealing whether a username exists …
krauseerl Oct 7, 2026
bdd0e03
feat(ai): contract for the Anthropic provider
claude Oct 10, 2026
f4edcff
feat(ocr): contract seam for Claude OCR
claude Oct 10, 2026
b30d395
feat(ocr): Claude as an OCR provider
claude Oct 10, 2026
c991fc5
test(ocr): Claude OCR against a fake Messages API
claude Oct 10, 2026
e52b6d8
Merge Claude OCR provider (stage 4)
claude Oct 10, 2026
e6370fc
feat(ai): token estimate for Claude models
claude Oct 10, 2026
00fd394
feat(ai): shared analysis prompt builder with response schema
claude Oct 10, 2026
a72e98d
feat(ai): Anthropic provider with structured output and prompt caching
claude Oct 10, 2026
33ff674
Merge Anthropic provider service (stages 1-3)
claude Oct 10, 2026
c853bca
docs(claude-md): describe the Anthropic provider
claude Oct 10, 2026
6ba9f74
feat(setup): validate and discover Anthropic models in setupService
claude Oct 10, 2026
4506a97
feat(settings): accept Anthropic in the setup and settings routes
claude Oct 10, 2026
f0e7a80
feat(support): report Anthropic in support info and failed reasons
claude Oct 10, 2026
0b50832
feat(settings): Anthropic block and Claude OCR on the settings and se…
claude Oct 10, 2026
8573ffd
Merge Anthropic setup, settings and OCR provider UI
claude Oct 10, 2026
fd98ded
Merge pull request #375 from admonstrator/claude/project-thread-ns6mxp
admonstrator Oct 12, 2026
0a67fa0
fix(auth): keep sessions across a settings save, and say when one ends
claude Oct 12, 2026
2df6fc9
fix(manual): rebuild the manual tagging page on the zr components
claude Oct 12, 2026
971e73c
chore(release): changelog and version for v2026.10.01
claude Oct 12, 2026
8b932da
Merge pull request #378 from admonstrator/claude/project-thread-ns6mxp
admonstrator Oct 12, 2026
a3301b4
fix(deps): close the fixable npm advisories on nightly
claude Oct 12, 2026
dccb236
Merge pull request #379 from admonstrator/claude/project-thread-ns6mxp
admonstrator Oct 12, 2026
8e2c30e
fix(settings): pick the Claude model from a dropdown like every other…
claude Oct 12, 2026
ee19ffe
Merge pull request #380 from admonstrator/claude/project-thread-ns6mxp
admonstrator Oct 12, 2026
4a84682
Merge remote-tracking branch 'origin/main' into claude/release-review…
claude Oct 12, 2026
417581b
fix(anthropic): strip trailing slashes from the Claude API URL in lin…
claude Oct 12, 2026
c4a02a7
fix(anthropic): only send the stored Claude key to a configured host
claude Oct 12, 2026
348a6c4
Merge #372 (OIDC single sign-on) into nightly for testing
claude Oct 12, 2026
e11212c
fix(oidc): keep SSO settings on settings save, keep the client secret…
claude Oct 12, 2026
8e68834
fix(oidc): refuse an e-mail address the provider marks unverified
claude Oct 12, 2026
44a3768
Merge pull request #382 from admonstrator/claude/nightly-oidc-372
admonstrator Oct 13, 2026
81b9325
chore(settings): expose OIDC_* to the settings view (contract for SSO…
claude Oct 13, 2026
9d19178
feat(settings): save, validate and test single sign-on on the setting…
claude Oct 13, 2026
d2ba293
Merge backend: save, validate and test single sign-on settings
claude Oct 13, 2026
ed85d90
feat(settings): one topic per view and a Single sign-on section
claude Oct 13, 2026
9933039
Merge UI: one topic per view and a Single sign-on section
claude Oct 13, 2026
001b8fd
Merge pull request #383 from admonstrator/claude/settings-sso
admonstrator Oct 13, 2026
84ac7ed
Merge nightly into release branch for v2026.10.01
claude Oct 13, 2026
53fd7d8
chore(release): changelog for single sign-on and the new settings page
claude Oct 13, 2026
281f1dd
fix(oidc): strip trailing slashes from the issuer URL in linear time
claude Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## What this is

Paperless-AI **next** — a community fork of clusterzx/paperless-ai. A Node.js/Express app that uses
LLMs (OpenAI, Ollama, Azure, or any OpenAI-compatible "custom" endpoint) plus optional OCR to auto-tag,
LLMs (OpenAI, Ollama, Azure, Anthropic, or any OpenAI-compatible "custom" endpoint) plus optional OCR to auto-tag,
title, classify, and extract metadata for documents in a Paperless-ngx instance. Server-rendered EJS UI,
no frontend framework. Single SQLite database (better-sqlite3, WAL mode).

Expand Down Expand Up @@ -54,12 +54,18 @@ the `services/` singletons.
`class Foo { ... }; module.exports = new Foo();`. Import and call directly; do not `new` them.

**AI provider abstraction:** `services/aiServiceFactory.js` returns the right service based on
`config.aiProvider` (`openai` | `ollama` | `custom` | `azure`). Every provider service implements
`config.aiProvider` (`openai` | `ollama` | `custom` | `azure` | `anthropic`). Every provider service implements
`analyzeDocument(content, doc, existingTags, correspondents)`. To add a provider: add a service singleton,
wire it into the factory switch, and add its config block in `config/config.js`.

**Token handling:** `services/serviceUtils.js` — `calculateTokens()` (tiktoken for OpenAI, ÷4 char
estimate otherwise) and `truncateToTokenLimit()`. Also holds AI-error → OCR-fallback classification
**Anthropic** is not OpenAI-compatible and has its own service (`services/anthropicService.js`). Per-model
request rules (thinking, effort, structured output, cache minimums), the client factory, usage mapping and
the truncation/refusal check live in `services/anthropicSupport.js` and are shared with Claude OCR; never
send `temperature` to it or read `content[0]`. Its analysis prompt and JSON schema come from
`services/analysisPrompt.js`, which the other providers do not use yet.

**Token handling:** `services/serviceUtils.js` — `calculateTokens()` (tiktoken for OpenAI, ÷3 char
estimate for `claude-*`, ÷4 otherwise) and `truncateToTokenLimit()`. Also holds AI-error → OCR-fallback classification
helpers used by the scan loop.

**Prompt restrictions:** `services/restrictionPromptService.js` replaces placeholders like
Expand All @@ -69,7 +75,7 @@ in prompts. The base prompts live in `config/config.js` (`specialPromptPreDefine
normalize them with `toNameList()` from `services/serviceUtils.js` instead of joining them directly.

**OCR:** `services/mistralOcrService.js` — provider can be `mistral`, `ollama` (native `/api/chat`
vision), or OpenAI-compatible `/v1`. OCR is a fallback path when AI analysis fails on low-text docs.
vision), OpenAI-compatible `/v1`, or `anthropic` (Claude reads PDFs and images natively). OCR is a fallback path when AI analysis fails on low-text docs.

**Database:** `models/document.js` — better-sqlite3 at `data/documents.db`, WAL mode, prepared
statements throughout. Key tables: `processed_documents`, `history_documents` (server-side paginated
Expand Down
Loading
Loading