Capability first · transport second

ChatRecords.js

Detects conversation entries and projects retained state into provider-safe recurring chat context.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
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

JavaScript
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

BindingFormDeclaration or signatureParameter syntax
hasConversationEntryfunctionfunction hasConversationEntry(chat=[])chat=[]
hasUserEntryfunctionfunction hasUserEntry(chat=[])chat=[]
recurringChatMessagesfunctionfunction recurringChatMessages(chat=[],{settleCompleteToolTail=false}={})chat=[],{settleCompleteToolTail=false}={}
CallableKindExact public signatureParameter syntax
hasConversationEntryexported-functionfunction hasConversationEntry(chat=[])chat=[]
hasUserEntryexported-functionfunction hasUserEntry(chat=[])chat=[]
recurringChatMessagesexported-functionfunction 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

JavaScript
import {recurringChatMessages} from '/arcane/modules/ChatRecords.js';

console.log(recurringChatMessages([
    {role:'user',content:'Find the record.'},
    {role:'assistant',content:'The record was found.'}
]));

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.