Releases: docmd-io/docmd-assistant
Release list
docmd-assistant@0.1.18
This release expands the multi-turn reasoning budget to 6 turns, introduces a real-time streaming replacement protocol (meta.replace: true) for live tokens, and adds architectural context synthesis fallbacks.
Key Features & Enhancements
Multi-Turn Reasoning Budget Expansion
- Extended Turn Ceiling: Increased maximum turns to 6, allowing tool-assisted investigations (e.g. searching structure, inspecting navigation, reading target pages) to complete without premature tool shutoff.
- Guaranteed Final Synthesis: Tools remain active across intermediate turns and are selectively disabled only on the final turn to guarantee clean synthesis.
Real-Time Streaming Replacement Protocol
- Unblocked SSE Token Streaming: Tokens stream immediately without intermediate suppression, emitting
{ replace: true }markers when transitioning across reasoning turns. - In-Place Live UI Editing: Downstream chat clients can smoothly overwrite intermediate thought chunks with synthesized responses in real time.
Architectural Context Synthesis Fallback
- Multi-Tier Context Synthesizer: When tool searches yield no dedicated documentation page, the engine automatically synthesises answers by referencing overarching project architecture and layout conventions.
Full Changelog: 0.1.17...0.1.18
docmd-assistant@0.1.17
This release makes docmd-assistant truly site-agnostic and universal, adds version and subproject filtering to documentation search, introduces token-economy document capping, strengthens context window boundaries, and improves network error resilience.
Key Features & Enhancements
Universal & Site-Agnostic System Prompt
- Authentic Knowledge Discovery: Shifted from hardcoded documentation manifest assumptions to a universal, site-agnostic prompt. The assistant dynamically explores and grounds its answers using available tools (
search_documentation,read_documentation_page), making it work seamlessly across any documentation site, blog, or project. - Retained Core Identity: Maintains the clean, professional "docmd assistant" persona without biasing retrieval assumptions toward specific build systems.
Version & Project Filtered Search
- Targeted Version Filtering: Extended
search_documentationparameter schema to support optionalversion(e.g."0.9.0","0.8.0","latest") andprojectfilters, enabling precise retrieval in multi-version or multi-project documentation setups. - Custom Delegate Passthrough: Forwarded
(query, project, version)arguments to consumer-providedonSearchimplementations.
Smart Content Capping & Context Window Safeguards
- DOM Reader Token Economy: Added an 8,000-character ceiling with a clean continuation indicator (
...[content capped for token economy]) inread_documentation_page, preventing oversized pages from exhausting LLM context limits while preserving essential content. - Context Window Floor: Enforced a minimum 1,000-character floor for
contextWindowoptions, preventing accidental micro-truncation from stripping retrieved documentation context.
Resilient Network Error Handling
- User-Friendly Error Translation: Intercepts low-level browser network failures (
Failed to fetch,Load failed) in both streaming and non-streaming modes and returns friendly, actionable error messages. - Clean Abort Handling: Gracefully handles cancelled requests and
AbortErrorwithout polluting runtime logs.
Full Changelog: 0.1.16...0.1.17
docmd-assistant@0.1.16
This release significantly improves documentation context delivery for AI agents, eliminates quote artifacts in user query forwarding, and adds multi-turn tool follow-up flagging for clean analytics logging.
Key Features & Enhancements
Expanded & Configurable Context Window
- Full Context Retention: Removed artificial 40,000-character caps on documentation page readers and increased default context window to 200,000 characters, delivering comprehensive documentation context to modern large-context LLMs.
- Configurable
contextWindow: Added optionalcontextWindowparameter toAssistantOptionsallowing users to tune retrieval length for token-constrained setups.
Clean Analytics & Tool Follow-Up Handling
- Tool Follow-Up Gating: Multi-turn tool execution calls now set
isToolFollowUp: true, allowing relays and analytics loggers to distinguish internal tool retrieval steps from actual visitor queries. - Orphaned Quote Elimination: Fixed prompt formatting where user questions were wrapped with double quotes that broke downstream log sanitizers when search context was appended.
- Normalized Tool Status Indicators: Replaced raw tool identifiers with clean human-readable activity labels ("Reading page...", "Searching docs...").
Full Changelog: 0.1.15...0.1.16
docmd-assistant@0.1.15
This release hardens LLM output sanitisation, prevents accidental stripping of documentation JSON snippets and code blocks, and enforces strict tool registration gating during autonomous execution loops.
Key Features & Enhancements
Strict Tool Registration & Name Validation
- Registered Tool Gating: Tool parser (
parseAssistantOutput) and execution loops (DocmdAssistantEngine) now strictly validate tool names against registered tools (knownToolNames/this.tools). - Markdown JSON Codeblock Preservation: JSON objects containing a
"name"property (such aspackage.json, configuration examples, or OpenAPI schemas) are preserved as documentation content rather than falsely parsed and stripped as tool calls. - Prose Keyword Protection: Hardened bracket and tag extraction to require explicit invocation formatting, preventing natural English sentences starting with
Action:,Call:, orTool:from being stripped from the response text.
Autonomous Loop Stability & Graceful Fallback
- Unregistered Tool Prevention: Execution loops now filter tool calls to ensure only tools actually registered on the engine are executed, preventing "Tool not registered" loops.
- Graceful Multi-Turn Termination: If the multi-turn autonomous execution loop reaches
maxTurns(5), the engine safely returns the latest generated clean response text rather than falling back to an empty string.
Resolved Issues
- AI Chat Response Stripping: Resolved an issue where documentation code snippets containing
"name"caused the assistant to respond with"No response generated."after search retrieval. - Tool Parsing False Positives: Fixed accidental stripping of natural prose containing
Action:orTool:keywords.
Full Changelog: 0.1.14...0.1.15
docmd-assistant@0.1.14
docmd-assistant v0.1.14 introduces a universal, provider-agnostic tool parser that reliably intercepts and executes AI tool calls across all major LLMs and output formats.
Key Features & Enhancements
Universal Multi-Format Tool Call Parser
- Balanced JSON Scanner: Reliably extracts inline JSON tool objects regardless of key ordering (
{"name": ..., "parameters": ...}or{"parameters": ..., "name": ...}), nested objects, or string-encoded argument payloads. - Markdown Codeblock Parsing: Detects and extracts tool payloads formatted inside standard Markdown code fences (
json ...,tool_call ...). - Bracketed Tool-Call Syntax: Added comprehensive regex extraction for bracketed and labeled tool expressions, including:
[Tool Call: search_documentation({"query":"..."})][Tool Call: get_site_structure()][TOOL_CALL: search_documentation(...)][Function Call: name(...)]
- Zero-Argument & Functional Syntax: Added support for zero-argument tool invocations (
get_site_structure()) and functional argument lists (tool_name(query="value")).
Registered Tools Matching
- Dynamic Registry Matching: Assistant engine execution loops now pass registered tool names (
search_documentation,get_site_structure, and custom tools) directly intoparseAssistantOutputfor deterministic recognition.
Zero Raw Tool String Leakage
- Clean User Chat Experience: Completely prevents unparsed tool-call markup from reaching human users in the chat interface; all tool invocations are executed autonomously and synthesised into clean, fact-grounded responses.
Resolved Issues
- docmd #206: AI chat returns tool-call string instead of real responses.
Full Changelog: 0.1.13...0.1.14
docmd-assistant@0.1.13
docmd-assistant v0.1.13 introduces robust payload management and clean context truncation for multi-turn RAG search synthesis.
Key Features & Enhancements
Clean Paragraph-Boundary Context Truncation
- Smart Paragraph Alignment: Context strings retrieved from documentation search results are truncated cleanly at double (
\n\n) or single (\n) newline boundaries, preventing arbitrary mid-sentence cuts. - Automatic Code Block Balancing: Detects unclosed triple-backtick fences (```) in truncated context blocks and automatically appends closing code fences to preserve Markdown syntax integrity.
- Expanded Context Capacity: Context window support expanded up to 15,000 characters per synthesis turn.
Sliding Window Conversation History
- History Management: Implemented automatic sliding window context retention for long multi-turn conversations, preserving up to the last 12 chat entries while preventing request payload bloat.
- System Prompt Safety Constraints: Updated system prompt instructions enforcing clean, structured Markdown output without raw unescaped HTML or script tags.
Cloud Relay Capacity Expansion
- 10x Relay Payload Capacity: Expanded the
api.docmd.iocloud relay payload limit from 5,000 to 50,000 characters, enabling comprehensive multi-page documentation RAG retrieval without request rejections.
Full Changelog: 0.1.12...0.1.13
docmd-assistant@0.1.12
docmd-assistant v0.1.12 delivers critical fixes for multi-turn tool execution during SSE streaming, ensuring seamless tool calls without leaking raw syntax into the chat UI.
Key Features & Enhancements
SSE Streaming Tool Loop Fixes
Fixed an issue in runRelayStreamLoop where Server-Sent Events (SSE) streaming responses containing tool calls exited early without executing local tools:
- Full Tool Execution in SSE: The SSE streaming reader now parses both structured
dataObj.tool_callsand text-based tool calls ([Tool Call: ...]), executes registered tools locally, and proceeds to Turn 2 synthesis. - Turn 1 Chunk Buffering: Tokens generated during Turn 1 tool evaluation are buffered until tool parsing completes, preventing raw tool call syntax from flashing inside user chat bubbles.
- Live Turn 2 Synthesis Streaming: Real-time token streaming (
callbacks.onChunk) is active during Turn 2 synthesis, delivering instant token-by-token rendering of final synthesized answers. - Status Badge Emission: Seamlessly emits tool status updates (
"Searching documentation for...") during SSE tool evaluation turns.
Full Changelog: 0.1.11...0.1.12
docmd-assistant@0.1.11
docmd-assistant v0.1.11 brings critical stability and reliability enhancements to the multi-turn autonomous tool execution loop, context-grounded response synthesis, non-streaming JSON fallback parsing, and keyword-first search decomposing.
Key Features & Enhancements
Multi-Turn Autonomous Tool Loop Stabilization
The relay streaming and standard HTTP execution loops (runRelayStreamLoop and runRelayLoop) have been re-architected for deterministic multi-turn tool execution:
- Original Query Preservation: The user's original query is explicitly tracked and maintained in the conversation history across all intermediate tool executions, ensuring the synthesis turn grounds its answer on the true user intent.
- Context-Grounded Synthesis Turn: When local tools (e.g.
search_documentation) execute, the retrieved documentation chunks are cleanly formatted and injected into a dedicated synthesis turn that instructs the LLM to provide a direct, comprehensive Markdown answer with clickable links. - Tool-Calling Loop Termination: Tool definitions are explicitly deactivated during the final synthesis turn to eliminate infinite tool loops and force immediate text output.
HTTP Stream & JSON Parsing Resiliency
Eliminated intermittent "No response returned" errors when interacting with serverless or proxy relay backends:
- Protocol Fallback: When a relay endpoint returns a standard JSON payload rather than a Server-Sent Events (
text/event-stream) stream, the reader automatically falls back to full-body parsing. - Buffer Recovery: The stream parser includes secondary buffer flushing to ensure complete message assembly even if the network connection terminates abruptly.
Keyword-First Search Query Decomposition
- Refined system prompt guidance and tool calling instructions to decompose natural language queries into targeted, high-precision search keywords (e.g.,
"install","config","cli") to maximize match accuracy on static site documentation indexes.
Enhanced Output Sanitizer Recovery
- Hardened
cleanAssistantReplyandparseAssistantOutputto gracefully recover text if the model generates reasoning blocks (<think>) without separate markdown content, preventing empty bubbles from reaching the chat UI.
Full Changelog: 0.1.10...0.1.11
docmd-assistant@0.1.10
This release introduces an autonomous multi-turn ReAct execution loop and universal model sanitization to ensure reliable, synthesized AI responses across all LLM providers.
Key Highlights
- Autonomous Multi-Turn Agent Loop:
- Automatically intercepts structured and text-based tool calls (
search_documentation,get_site_structure, etc.). - Executes tool handlers locally against documentation and search indexes.
- Feeds tool execution results back into the conversation context to produce fully synthesized, human-readable answers in a single user turn.
- Automatically intercepts structured and text-based tool calls (
- Provider-Agnostic Output Sanitizer:
- Replaced hardcoded provider filters with a universal tag cleaner that automatically strips internal reasoning/thinking blocks (
<think>,<thought>,<reasoning>, etc.) without printing internal monologues to the user. - Universal JSON tool-call fallback parsing for models emitting raw text blocks.
- Replaced hardcoded provider filters with a universal tag cleaner that automatically strips internal reasoning/thinking blocks (
- Live Streaming API Foundation:
- Added
sendMessageStream(query, { onStatus, onChunk, onToolCall, onToolResult, onFinish })for real-time token streaming and status updates.
- Added
Full Changelog: 0.1.9...0.1.10
docmd-assistant@0.1.9
docmd-assistant v0.1.9 introduces comprehensive LLM output sanitisation, autonomous and proactive search execution, smart version/locale relevance boosting, and enhanced chat flow stability across local and relay runtimes.
Key Features & Enhancements
LLM Output Sanitisation & Artifact Stripping
cleanAssistantReply() now aggressively strips reasoning/thinking tokens (<think>, <mm:think>), raw tool XML tags (<tool_call>, <request>), and internal provider metadata markers (e.g. minimax wrappers) before saving messages or rendering them to the user:
import { cleanAssistantReply } from 'docmd-assistant';
const clean = cleanAssistantReply(rawModelOutput);Proactive Tool Execution & Autonomous Search
The system prompt and execution pipeline now mandate autonomous tool usage for technical, version, and release-note queries:
- No Permission Loops: The assistant directly executes
search_documentationorget_site_structureto retrieve accurate facts rather than asking the user for confirmation ("Would you like me to search?"). - Release Notes & Patch Intelligence: Automatically performs targeted searches on queries regarding the latest release or patch notes (e.g.
v0.9.1) without relying solely on static branch identifiers.
Version-Scoped Ranking & Filter Optimisation
- Active Version Boosting: Enhanced search scoring logic prioritising documents matching the active documentation branch and active locale.
- Legacy Exclusion: Automatically excludes or deprioritises older archived documentation branches unless the user explicitly requests historical information.
Enhanced Chat State Stability
- Hardened internal turn tracking in
runRelayTurnandrunAiplugTurn. - Guaranteed message synchronisation and error boundary protection preventing broken chat UI states during relay interruptions.
Full Changelog: 0.1.8...0.1.9