On this page
Overview
Detects conversation entries and projects retained state into provider-safe recurring chat context.
- Artifact
ChatRecords.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Boolean conversation-entry results and recurring provider context are normalized.
Import and lifecycle
import * as module from '/arcane/modules/ChatRecords.js';
Pure predicates and recurring-context projection with no storage or host side effects.
Application-facing behavior: hasUserEntry(), hasConversationEntry(), and recurringChatMessages(chat,{settleCompleteToolTail=false}={}); the optional flag settles a completed restored tail that has no active provider continuation.
Protocol and host implementation
In-process only This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
hasConversationEntry | function | function hasConversationEntry(chat=[]) | chat=[] |
hasUserEntry | function | function hasUserEntry(chat=[]) | chat=[] |
recurringChatMessages | function | function recurringChatMessages(chat=[],{settleCompleteToolTail=false}={}) | chat=[],{settleCompleteToolTail=false}={} |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
hasConversationEntry | exported-function | function hasConversationEntry(chat=[]) | chat=[] |
hasUserEntry | exported-function | function hasUserEntry(chat=[]) | chat=[] |
recurringChatMessages | exported-function | function recurringChatMessages(chat=[],{settleCompleteToolTail=false}={}) | chat=[],{settleCompleteToolTail=false}={} |
Parameter meanings and results
hasUserEntry(chat) accepts a message array or a {messages} record and returns true when any message has role equal to user. hasConversationEntry(chat) also recognizes a complete assistant-only opening as a durable conversation entry. recurringChatMessages(chat,{settleCompleteToolTail=false}={}) retains one structural-call tail for its active provider continuation and projects every settled exchange into complete ordinary visible messages. settleCompleteToolTail:true projects a fully resulted restored tail when no continuation is active, while an unresolved call remains raw.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- Malformed settled structural-call arguments reject with the configured chat tool-call error code.
Availability and capabilities
Cross-host. Boolean conversation-entry results and recurring provider context are normalized.
Shared chat-record predicates and provider-context projection with no Core dependency.
Contract example
import {recurringChatMessages} from '/arcane/modules/ChatRecords.js';
console.log(recurringChatMessages([
{role:'user',content:'Find the record.'},
{role:'assistant',content:'The record was found.'}
]));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.