Capability first · transport second

DataMaintenance.js

Deletes empty chats and associated/empty memory records inside the current app data scope.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Deletes empty chats and associated/empty memory records inside the current app data scope.

  • Artifact
    DataMaintenance.js · esm
  • Classification
    public first party
  • Availability
    Browser / native WebView
  • Normalization
    Normalized counts; destructive storage failures preserved.

Import and lifecycle

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

Import initializes DBOPFS if needed; clearEmptyChatsAndMemories reads chats and memories and permanently deletes empty chats plus associated or empty memories.

Application-facing behavior: clearEmptyChatsAndMemories() plus content predicates.

Protocol and host implementation

Global DBOPFS This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
clearEmptyChatsAndMemoriesfunctionasync function clearEmptyChatsAndMemories()
hasConversationEntryre-exporthasConversationEntry
hasMemoryContentre-exporthasMemoryContent
hasUserEntryre-exporthasUserEntry
CallableKindExact public signatureParameter syntax
clearEmptyChatsAndMemoriesexported-functionasync function clearEmptyChatsAndMemories()

Parameter meanings and results

clearEmptyChatsAndMemories() waits for window.dbopfs and returns {checkedChats, checkedMemories, deletedChats, deletedMemories, failed}. hasConversationEntry preserves user-authored chats and complete assistant-only model openings; hasUserEntry and hasMemoryContent remain available for their narrower predicates.

Events, side effects, and errors

Source-literal CustomEvent dispatches

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

Lifecycle and event flow

  • consumes dbopfs-ready

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • DBOPFS and storage read or delete failures propagate
  • per-item delete rejections contribute to failed

Availability and capabilities

Browser / native WebView. Normalized counts; destructive storage failures preserved.

Browser and native-WebView application-data maintenance over app-scoped OPFS with no Core service.

Contract example

JavaScript
import {clearEmptyChatsAndMemories} from '/arcane/modules/DataMaintenance.js';

// Destructive: run only after the user chooses to remove empty records.
const report=await clearEmptyChatsAndMemories();
console.log(report);

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