CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-fluidframework--container-loader

Fluid container loader providing core container loading functionality for the Fluid Framework

57%

Overall

Evaluation57%

0.98x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-9/

Collaborative Runtime Lifecycle Monitor

Provide a lightweight adapter that listens to a collaborative runtime and exposes lifecycle signals for hosts to prevent data loss and react to shutdown.

Capabilities

Tracks dirty-to-saved transitions

  • When the runtime reports unsaved local edits and then persistence, the adapter toggles a dirty flag and invokes the corresponding callbacks. @test

Distinguishes closure vs disposal

  • When the runtime signals shutdown, the adapter surfaces whether it was a close or full disposal and passes along any provided reason. @test

Surfaces readonly and disconnect changes

  • When the runtime becomes readonly, especially while disconnected, the adapter records the readonly cause and notifies listeners once. @test

Stops emitting after teardown

  • After teardown is requested, further runtime signals do not trigger callbacks or mutate adapter state. @test

Implementation

@generates

API

export interface LifecycleRuntime {
  readonly isDirty?: boolean;
  readonly closed?: boolean;
  on(
    event: "dirty" | "saved" | "closed" | "disposed" | "readonly" | "connected" | "disconnected",
    listener: (...args: any[]) => void,
  ): void;
  off(
    event: "dirty" | "saved" | "closed" | "disposed" | "readonly" | "connected" | "disconnected",
    listener: (...args: any[]) => void,
  ): void;
}

export interface LifecycleCallbacks {
  onDirty?: () => void;
  onSaved?: () => void;
  onClose?: (info: { disposed: boolean; reason?: string }) => void;
  onReadonly?: (info: { enforced: boolean; reason?: string; disconnected: boolean }) => void;
  onConnectionChange?: (connected: boolean) => void;
}

export interface LifecycleAdapter {
  readonly dirty: boolean;
  readonly closed: boolean;
  readonly readonlyState?: { enforced: boolean; reason?: string; disconnected: boolean };
  start(): void;
  stop(): void;
}

export function createLifecycleAdapter(
  runtime: LifecycleRuntime,
  callbacks?: LifecycleCallbacks,
): LifecycleAdapter;

Dependencies { .dependencies }

@fluidframework/container-loader { .dependency }

Provides collaborative runtime lifecycle and dirty-state events.

tessl i tessl/npm-fluidframework--container-loader@2.60.0

tile.json