Capability first · transport second

ConversationTimebox.js

Owns conversation limits, control messages, submission barriers, elapsed formatting, and delivery proof.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Owns conversation limits, control messages, submission barriers, elapsed formatting, and delivery proof.

  • Artifact
    ConversationTimebox.js · esm
  • Classification
    public first party
  • Availability
    Cross-host
  • Normalization
    State/command/delivery errors plus exact required user-facing message are normalized.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/ConversationTimebox.js';

ConversationTimebox starts and cancels a periodic tick, holds in-memory deadline state, and notifies subscribed callbacks; dispose cancels the timer and clears listeners.

Application-facing behavior: Event/error/reason constants; default ConversationTimebox, ConversationSubmissionBarrier, control constants/helpers, required message tool schema, state-free on/addEventListener compatibility, and dispose().

Protocol and host implementation

Clock/timers, callbacks, and per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
CONVERSATION_TIMEBOX_EVENT_TYPESvariable · valuevariable CONVERSATION_TIMEBOX_EVENT_TYPES
CONVERSATION_TIMEBOX_ERROR_CODESvariable · valuevariable CONVERSATION_TIMEBOX_ERROR_CODES
CONVERSATION_TIMEBOX_REASONSvariable · valuevariable CONVERSATION_TIMEBOX_REASONS
appendConversationTimeboxOpeningInstructionfunctionfunction appendConversationTimeboxOpeningInstruction(message='')message=''
CONVERSATION_TIMEBOX_LIMIT_MESSAGEvariable · valuevariable CONVERSATION_TIMEBOX_LIMIT_MESSAGE
CONVERSATION_TIMEBOX_OPENING_INSTRUCTIONvariable · valuevariable CONVERSATION_TIMEBOX_OPENING_INSTRUCTION
CONVERSATION_TIMEBOX_TOOL_NAMEvariable · valuevariable CONVERSATION_TIMEBOX_TOOL_NAME
ConversationSubmissionBarrierclassclass ConversationSubmissionBarrier
consumeConversationTimeboxCallfunctionfunction consumeConversationTimeboxCall(calls,controller)calls,controller
conversationTimeboxToolvariable · valuevariable conversationTimeboxTool
conversationTimeboxSubmissionKeyfunctionfunction conversationTimeboxSubmissionKey(context={})context={}
createConversationTimeboxControlMessagefunctionfunction createConversationTimeboxControlMessage(action,milliseconds)action,milliseconds
formatConversationElapsedfunctionfunction formatConversationElapsed(milliseconds=0)milliseconds=0
normalizeConversationTimeboxCommandfunctionfunction normalizeConversationTimeboxCommand(value)value
requireConversationTimeboxDeliveryfunctionfunction requireConversationTimeboxDelivery(result)result
defaultdefault · classclass ConversationTimebox
MemberKindExact public declarationParameter syntax
ConversationTimebox.constructorconstructorconstructor(options={})options={}
ConversationSubmissionBarrier.pendingCountgetget pendingCount()
ConversationSubmissionBarrier.trackmethodtrack(result)result
ConversationSubmissionBarrier.waitForIdleasync methodasync waitForIdle()
ConversationTimebox.limitReachedMessagegetget limitReachedMessage()
ConversationTimebox.controlMessagemethodcontrolMessage(action,milliseconds)action,milliseconds
ConversationTimebox.startmethodstart()
ConversationTimebox.setLimitMillisecondsmethodsetLimitMilliseconds(milliseconds,{source='user'}={})milliseconds,{source='user'}={}
ConversationTimebox.adjustLimitMillisecondsmethodadjustLimitMilliseconds(milliseconds,{source='user'}={})milliseconds,{source='user'}={}
ConversationTimebox.clearLimitmethodclearLimit({source='user'}={}){source='user'}={}
ConversationTimebox.applyCommandmethodapplyCommand(value)value
ConversationTimebox.subscribemethodsubscribe(listener,options={})listener,options={}
ConversationTimebox.snapshotmethodsnapshot()
ConversationTimebox.disposemethoddispose()

Parameter meanings and results

The class starts, sets, adjusts, clears, applies, snapshots, subscribes, and disposes limits. conversationTimeboxTool requires action and a nonempty string message in every function argument object; set and adjust also require duration_milliseconds. normalizeConversationTimeboxCommand preserves message, and applyCommand plus a fulfilled consumeConversationTimeboxCall result return the changed state with that user-facing message. Exported helpers also cover sole-tool commands, control messages, elapsed display, submission keys, barriers, and delivery proof.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • subscriber snapshot
  • subscriber change
  • subscriber tick
  • subscriber due

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • TypeError or RangeError for invalid options, clock, commands, durations, or dates
  • CONVERSATION_TIMEBOX_MUST_BE_SOLE_CALL
  • requireConversationTimeboxDelivery throws on false

Availability and capabilities

Cross-host. State/command/delivery errors plus exact required user-facing message are normalized.

Cross-host conversation control contract using clocks and callbacks; it supplies a provider tool schema but does not call Core.

Contract example

JavaScript
import ConversationTimebox from '/arcane/modules/ConversationTimebox.js';

let now=1000;
const box=new ConversationTimebox({
    clock:()=>now,
    schedule:()=>1,
    cancel:()=>{},
    tickMs:1000
});
box.start();
console.log(box.applyCommand({
    action:'set',
    duration_milliseconds:60_000,
    message:'Setting the requested one-minute time check.'
}));
box.dispose();

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