import { ToolRegistry } from '../tools/tool-registry.js'; import type { KnowledgeModule } from '@rdk-moss/core'; import { type MossAsyncTaskRegistry } from '@rdk-moss/core/contracts/async-task'; import { PlatformExtensionRegistry } from '../../extensions/registry.js'; import { type GoalState } from '../goal/goal-state.js'; import { PendingToolAbortStore } from '../loop/pending-tool-aborts.js'; import { SpawnProfileRegistry } from '../subagent/spawn-profile.js'; import { type PreToolUseHook, type PostToolUseHook } from '../tools/tool-hooks.js'; import { CommandQueueRegistry } from './command-queue.js'; import { type SessionInboxEntry, type SessionInboxDelivery } from '../session/session-inbox.js'; import { type SessionDrainResult } from '../session/session-drain.js'; import { type SessionEvent } from '../session/session-event.js'; import { type ProjectedMessage } from '../session/session-event-projector.js'; import { type ContextSources } from '../session/context-epoch.js'; import type { MossAgentConfig as SharedMossAgentConfig, ChatOptions as SharedChatOptions, ChatResult as SharedChatResult, MossAgentEvent as SharedMossAgentEvent, InternalMessage as SharedInternalMessage, InternalContentBlock as SharedInternalContentBlock } from './moss-agent-types.js'; export type MossAgentConfig = SharedMossAgentConfig; export type ChatOptions = SharedChatOptions; export type ChatResult = SharedChatResult; export type MossAgentEvent = SharedMossAgentEvent; export type InternalMessage = SharedInternalMessage; export type InternalContentBlock = SharedInternalContentBlock; export declare class MossAgent { readonly pendingToolAborts: PendingToolAbortStore; readonly tools: ToolRegistry; readonly config: MossAgentConfig; readonly extensions: PlatformExtensionRegistry; readonly commandQueues: CommandQueueRegistry; readonly spawnRegistry: SpawnProfileRegistry; readonly asyncTasks: MossAsyncTaskRegistry; private readonly knowledge; private readonly ownsKnowledgeRegistry; private readonly ownsAsyncTaskRegistry; private readonly rootAbortController; private disposed; private closePromise; private readonly activeStreamAdvances; private steeringEngine; private readonly remoteCompactProvider; private readonly toolHooks; private readonly packPromptLayers; private readonly packHostRequirements; private readonly inboxes; private readonly activeRunIds; private readonly sessionCheckpointWrites; /** Per-instance run-epoch store used by the agent loop's stream-push guard. * Each MossAgent instance carries its own Map so parallel MossAgents in * the same host (which may share sessionKeys) don't stomp each other's * live streams. See agent-loop-push-guard.ts for the design. */ private readonly runEpochStore; constructor(config: MossAgentConfig); registerKnowledge(module: KnowledgeModule): void; dispose(): void; close(): Promise; private assertOpen; buildSystemPrompt(options?: { platform?: string; extraContext?: string; omitExtraPromptLayers?: boolean; }): string; getCapabilityPackRequirements(): string[]; registerPreToolHook(hook: PreToolUseHook): void; unregisterPreToolHook(name: string): boolean; registerPostToolHook(hook: PostToolUseHook): void; unregisterPostToolHook(name: string): boolean; chat(sessionKey: string, userMessage: string, options?: ChatOptions): Promise; private loadGoalState; private saveGoalState; private withSessionCheckpointWrite; private replaceMessagesPreservingLatestGoal; setGoal(sessionKey: string, objective: string): Promise; getGoal(sessionKey: string): Promise; pauseGoal(sessionKey: string, reason?: string): Promise; resumeGoal(sessionKey: string): Promise; completeGoal(sessionKey: string, reason?: string): Promise; blockGoal(sessionKey: string, reason?: string): Promise; clearGoal(sessionKey: string): Promise; private inboxFilePath; private inboxFor; private persistInbox; admit(sessionKey: string, prompt: string, options?: { delivery?: SessionInboxDelivery; id?: string; }): SessionInboxEntry; inboxPending(sessionKey: string): readonly SessionInboxEntry[]; steer(sessionKey: string, prompt: string): SessionInboxEntry | null; private takeSteeringMessages; private retireSteeringMessages; private noteRunStarted; private noteRunFinished; drainInbox(sessionKey: string, options?: ChatOptions): Promise<{ chats: ChatResult[]; drain: SessionDrainResult; }>; private eventLogFilePath; streamChatRecorded(sessionKey: string, userMessage: string, options?: ChatOptions): AsyncGenerator; sessionEvents(sessionKey: string): readonly SessionEvent[]; projectedConversation(sessionKey: string): ProjectedMessage[]; private contextEpochFilePath; reconcileSessionContext(sessionKey: string, sources: ContextSources, baselineSeq?: number): { baseline: string; update?: string; }; private buildSummarizeFn; compactSession(sessionKey: string, customInstructions?: string, options?: { abortSignal?: AbortSignal; }): Promise<{ compacted: boolean; summary?: string; summaryChars: number; droppedMessages: number; tokensAfter: number; }>; /** * Rewind the conversation (LLM context) to the first `toMessageCount` * messages, discarding everything after — the grok-style conversation * rewind that complements /rewind's file restore. The agent's next turn * loads the truncated store, so it continues from before the rewound turn. * * The goal checkpoint is preserved if it falls within the kept slice; if * the rewind drops it (the user rewound past goal creation), the persisted * goal is removed. (In-memory goal-cache desync in that edge case is * resolved on the next goal read, which reloads from the store.) * * The visual transcript (session event log) is NOT truncated — like * /compact, the TUI keeps the history as a record and shows a "rewound" * system line. */ rewindConversation(sessionKey: string, toMessageCount: number): Promise<{ truncated: number; }>; private createAgentLoopRun; private persistTaskFrameState; private refreshActiveTaskFrameCheckpoint; private adaptMiniStreamEvents; private notifyRunObserver; private teardownAgentLoopRun; private streamChatViaAgentLoop; streamChat(sessionKey: string, userMessage: string, options?: ChatOptions): AsyncGenerator; } //# sourceMappingURL=moss-agent.d.ts.map