0a9788e89a
feat(collab): separate agent edits from human edits in page history
vvzvlad
2026-06-17 06:40:28 +03:00
b0997cb749
feat(ai-chat)!: drop updateComment from the agent toolset
vvzvlad
2026-06-17 06:03:19 +03:00
eefbf67288
feat(ai-chat): external MCP servers admin UI (E3)" -m "Admin 'AI / External tools (MCP)' settings section: list/add/edit/delete external MCP servers, per-server enable toggle and Test (lists the server's tools), write-only auth headers (never shown), tool allowlist, and a Tavily preset (key in the Authorization header, not the URL). Consumes the existing admin /workspace/ai-mcp-servers endpoints. Fixes a discriminated-union narrowing type error in the (previously untracked) server form.
vvzvlad
2026-06-17 05:57:37 +03:00
6ec91c8a2c
feat(ai-chat): expose full Docmost toolset to the in-app agent
vvzvlad
2026-06-17 05:14:45 +03:00
65f0713a70
fix(ai-chat): live streaming, open-page context, any-dimension embeddings" -m "- streaming: give useChat a STABLE store id (chatId ?? per-mount generated) so the v6 hook stops re-creating its store every render on a new chat (which wiped the optimistic user message + streamed deltas, so nothing showed until the turn finished). Also send X-Accel-Buffering:no + flushHeaders. - context: client sends the currently-open page {id,title}; the system prompt tells the agent which page 'this page' refers to (it reads it via its CASL-scoped getPage tool; id is prompt-context only, no server-side fetch). - embeddings: make page_embeddings.embedding dimension-agnostic (drop the HNSW index + ALTER to vector), remove the hard 1536 guard, filter search by model_dimensions — so 3072-dim (and any) models index instead of being skipped. Seq-scan <=> search (wiki scale); existing pages reindex on next edit.
vvzvlad
2026-06-17 04:58:06 +03:00
a4b7919753
fix(ai-chat): OpenAI Chat Completions for multi-turn + provider settings, stream UX & errors" -m "Live-stand fixes (OpenRouter / OpenAI-compatible): - openai provider: use .chat() (Chat Completions) instead of the default callable (Responses API), which gateways reject on multi-turn -> 400. - updateAiProviderSettings: assemble settings.ai.provider via jsonb_build_object with ::text-cast bound params + jsonb_typeof self-heal (postgres.js was double-encoding it into an array; the ::text cast avoids 'could not determine data type of parameter'). - chat agent: drop the hard maxOutputTokens cap (truncated complex tool calls); keep a tiny cap only on the test-connection ping. - testConnection + chat stream: surface the real provider error (statusCode+message) to logs and the UI instead of generic masks; never log the API key. - chat UI: typing indicator, incremental streaming render, tool 'running' status, Stop.
vvzvlad
2026-06-17 04:28:29 +03:00
44b340dc1a
feat(ai-chat): agent write tools, provenance wiring, chat panel + provider settings UI" -m "Backend: - Add reversible write tools to the per-user agent toolset (page create/update/ move/soft-delete; comment reply + resolve), exposed under the user's JWT and enforced by Docmost CASL; no permanent/force delete (D3). - Non-spoofable agent provenance: sign actor/aiChatId into the access and collab tokens (TokenService), propagate via jwt.strategy onto the request, and set pages.last_updated_source/last_updated_ai_chat_id on REST create/update/move and comments.created_source/resolved_source/ai_chat_id. - packages/mcp: add an optional getCollabToken provider (content-edit provenance) and guard against empty tokens; service-account /mcp path unchanged.
vvzvlad
2026-06-17 02:39:26 +03:00