import type { GameEvent, GameState, ObservationFrame } from '../module-input/index.js'; import type { BehaviorInputFieldSpec } from '../behavior-plugin/index.js'; /** Reminder classes use the same public Perception API version and resource lifecycle. */ export const REMINDER_PLUGIN_API_VERSION = 2 as const; export type ReminderTopic = 'tasks' | 'speech'; export type ReminderMode = 'wake' | 'silent' | 'state_only'; export interface ReminderFact extends GameEvent { readonly producer: 'backend_push' | 'local_synth'; readonly replayed?: boolean; } /** Structural task changes, not Agent notifications or inferred completion facts. */ export interface ReminderTaskChange { readonly key: string; readonly eventId: string; readonly epochId?: number; readonly change: 'added' | 'removed' | 'status_changed' | 'updated'; readonly task: Readonly>; readonly before?: Readonly>; readonly from_status?: string; readonly to_status?: string; readonly baseline: boolean; } export interface ReminderInput { readonly cycle?: import('../module-input/index.js').ProcessingCycleInfo; readonly scope: Readonly<{ sessionId: string; segmentId: string }>; readonly frame: Readonly | null; readonly gameState: Readonly | null; readonly facts: readonly Readonly[]; /** Module-local comparison of consecutive task snapshots; no cross-perception dependency. */ readonly taskChanges: readonly ReminderTaskChange[]; /** Establish private baselines without replaying notifications. */ readonly boundary: 'initial' | 'recovery' | null; readonly config: Readonly>; /** Host-persisted state from the previous completed update; never use instance fields for recovery. */ readonly state: unknown; readonly nowMs: number; } export interface ReminderResult { readonly state?: unknown; readonly events?: readonly ReminderEvent[]; } export interface ReminderEvent { readonly type: 'reminder.task' | 'reminder.speech'; /** Stable per occurrence, retained across retry/recovery. */ readonly key: string; readonly wakeAgent: boolean; readonly payload: Readonly> & { readonly text: string }; } export interface ClawclawReminderManifest { readonly apiVersion: typeof REMINDER_PLUGIN_API_VERSION; readonly kind: 'reminder'; readonly id: string; readonly description: string; readonly name?: string; readonly localizations?: import('../resource-metadata.js').ClawclawResourceLocalizations; readonly topic: ReminderTopic; readonly consumes: readonly string[]; /** Optional validation schema for parameters carried in this module's own manifest. */ readonly inputs?: readonly BehaviorInputFieldSpec[]; readonly config?: Readonly>; } /** Non-visual perception rule. Runtime supplies durable state and bounds the Worker. */ /** @deprecated API v2 compatibility; future support may end. New scripts use ClawclawPerception API v3. */ export abstract class ClawclawReminder { static readonly manifest?: ClawclawReminderManifest; abstract update(input: Readonly): ReminderResult | Promise; }