Capability first · transport second

ConversationClosingReport.js

Defines the closing-report tool, instruction, result normalizer, call classifier, and formatter.

SDK 0.97.1Runtime 0.8.12Protocol arcane/1
On this page

Overview

Defines the closing-report tool, instruction, result normalizer, call classifier, and formatter.

  • Artifact
    ConversationClosingReport.js · esm
  • Classification
    public first party
  • Availability
    Cross-host
  • Normalization
    Required user-facing message remains distinct from the complete final_message; normalized results expose message, finalMessage, and rememberedActions. Optional responseToUsersPromptComplete is preserved only when supplied as a boolean, with no coercion or default; it is transient app-owned control metadata outside saved history.

Import and lifecycle

JavaScript
import * as module from '/node_modules/arcane-os/runtime/arcane/modules/ConversationClosingReport.js';

Pure tool-schema, instruction, classification, normalization, and escaped-text formatting; it performs no inference, persistence, rendering, action, navigation, or delivery.

Application-facing behavior: Seven constants/helpers for closing reports; the sole-call schema requires message and finalmessage. createConversationClosingReportTool optionally accepts responseToUsersPromptComplete:{required:false,description:} to declare the boolean, or required:true to require it; omission preserves the existing schema. The normalizer remains independent of factory options and orchestration remains app-owned. formatConversationClosingReportText(value) exposes the existing &, escaping for any string, including whitespace-only chunks, and the complete report formatter reuses it.

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
formatConversationClosingReportTextfunctionfunction formatConversationClosingReportText(value)value
createConversationClosingReportToolfunctionfunction createConversationClosingReportTool({ name=DEFAULT_TOOL_NAME, description='Prepare a complete closing report when the user clearly ends a conversation.', responseToUsersPromptComplete }={}){ name=DEFAULT_TOOL_NAME, description='Prepare a complete closing report when the user clearly ends a conversation.', responseToUsersPromptComplete }={}
conversationClosingReportInstructionfunctionfunction conversationClosingReportInstruction({ enabled=true, toolName=DEFAULT_TOOL_NAME, completionTrigger='the user clearly says they are finished or explicitly asks to wrap up' }={}){ enabled=true, toolName=DEFAULT_TOOL_NAME, completionTrigger='the user clearly says they are finished or explicitly asks to wrap up' }={}
normalizeConversationClosingReportfunctionfunction normalizeConversationClosingReport(value)value
classifyConversationClosingReportCallsfunctionfunction classifyConversationClosingReportCalls(calls={}, { toolName=DEFAULT_TOOL_NAME }={})calls={}, { toolName=DEFAULT_TOOL_NAME }={}
formatConversationClosingReportfunctionfunction formatConversationClosingReport(value)value
CONVERSATION_CLOSING_REPORT_TOOL_NAMEalias · valueDEFAULT_TOOL_NAME as CONVERSATION_CLOSING_REPORT_TOOL_NAME—

Parameter meanings and results

createConversationClosingReportTool(options) returns a mutable function-tool schema requiring nonempty string message and final_message fields; remembered_actions remains optional. The opt-in responseToUsersPromptComplete:{required:false,description:<nonblank app-owned string>} option declares a boolean argument and preserves the complete description; required:true adds it to required fields. Omitting the option preserves the existing schema. normalizeConversationClosingReport(value) accepts an object or JSON and returns mutable {message,finalMessage,rememberedActions} plus responseToUsersPromptComplete only when supplied as a boolean, preserving true or false without coercion or a default. Other supplied types raise CONVERSATION_CLOSING_REPORT_INVALID. The normalizer does not enforce factory options; the classifier still accepts only a sole named call. The application owns completion and continuation; the flag is transient control metadata outside saved chat history. message is the brief user-facing progress text for accepting and rendering the call, while final_message remains the complete closeout. formatConversationClosingReport(value) normalizes the full report and formats only its final text through formatConversationClosingReportText(value). That shared text operation accepts any string, including empty and whitespace-only chunks, and escapes only &, <, and > without trimming, report validation, rendering, or persistence.

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

  • CONVERSATION_CLOSING_REPORT_INVALID

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • CONVERSATION_CLOSING_REPORT_INVALID

Availability and capabilities

Cross-host. Required user-facing message remains distinct from the complete final_message; normalized results expose message, finalMessage, and rememberedActions. Optional responseToUsersPromptComplete is preserved only when supplied as a boolean, with no coercion or default; it is transient app-owned control metadata outside saved history.

Provider-neutral terminal tool contract; the app and provider own calling and any consented local persistence.

Contract example

JavaScript
import {normalizeConversationClosingReport, formatConversationClosingReport} from '/node_modules/arcane-os/runtime/arcane/modules/ConversationClosingReport.js';

const report=normalizeConversationClosingReport({
    message:'Preparing the conversation closeout.',
    final_message:'All requested work is complete.',
    remembered_actions:[]
});
console.log(formatConversationClosingReport(report));

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