import type { MastraDBMessage } from '../../agent/message-list/index.js'; import type { StorageThreadType } from '../../memory/index.js'; import type { HarnessPendingItemRecord } from '../../storage/domains/harness/index.js'; import type { EventEmitter } from './events.js'; import type { HarnessMode } from './mode.js'; import type { CloneSessionOptions, SessionConfig, SessionSignalOptions } from './session.types.js'; import type { HarnessSkill } from './skills.types.js'; export declare class Session { #private; constructor(config: SessionConfig); get id(): string; get ownerId(): string; get resourceId(): string; get threadId(): string; get createdAt(): Date; get lastActivityAt(): Date; get parentSessionId(): string | undefined; get subagentDepth(): number; isBusy(): boolean; waitForIdle(opts?: { timeout?: number; }): Promise; getQueueDepth(): number; getCurrentRunId(): string | null; getCurrentTraceId(): string | null; listPendingItems(): HarnessPendingItemRecord[]; spawnSubagentSession(opts: { agentType: string; prompt: string; modelId?: string; forked?: boolean; }): Promise<{ isError: false; subagentSessionId: string; threadId: string; resourceId: string; agentType: string; depth: number; } | { isError: true; code: 'harness.subagent_depth_exceeded'; message: string; details: { maxDepth: number; attemptedDepth: number; }; }>; registerPendingItem(item: Omit & { createdAt?: Date; updatedAt?: Date; }): Promise; updatePendingItem(pendingItemId: string, updates: Partial>): Promise; removePendingItem(pendingItemId: string): Promise; respondToToolApproval(pendingItemId: string, response: Record): Promise; respondToToolSuspension(pendingItemId: string, response: Record): Promise; respondToQuestion(pendingItemId: string, response: Record): Promise; respondToPlanApproval(pendingItemId: string, response: Record): Promise; clone(opts?: CloneSessionOptions): Promise>; getThread(): Promise; getMessages(): Promise; saveMessages(messages: MastraDBMessage[]): Promise<{ messages: MastraDBMessage[]; usage?: { tokens: number; }; }>; getState(): Readonly; setState(updates: Partial): Promise; updateState(updater: (state: Readonly) => { updates?: Partial; events?: Parameters[0][]; result: TResult; } | Promise<{ updates?: Partial; events?: Parameters[0][]; result: TResult; }>): Promise; getModelId(): string; setModelId(modelId: string): void; getMode(): HarnessMode; signal({ messages, ...options }: SessionSignalOptions): Promise; setMode(mode: HarnessMode): void; /** * Returns the workspace skill catalog. Workspace discovery is async on first * call and cached for the lifetime of the session (use `refreshSkills` to * invalidate). */ listSkills(): Promise; /** * Look up a single skill by name. Returns `null` when no skill matches; * use `useSkill` when a missing skill should be a hard error. */ getSkill(name: string): Promise; /** * Activate a skill by name and return the canonical skill instructions string. * * Throws `HarnessSkillNotFoundError` when the skill cannot be resolved. */ useSkill(name: string): Promise; /** * Invalidate the workspace skill discovery cache. The next `listSkills` or * `useSkill` call will re-query the workspace. */ refreshSkills(): void; } //# sourceMappingURL=session.d.ts.map