import { Schema, Context, Effect, Layer } from 'effect'; import * as effect_Cause from 'effect/Cause'; import * as effect_Types from 'effect/Types'; import * as _reactive_agents_core from '@reactive-agents/core'; import { EventBus } from '@reactive-agents/core'; declare const InteractionModeType: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; type InteractionModeType = typeof InteractionModeType.Type; declare const SessionId: Schema.brand; type SessionId = typeof SessionId.Type; declare const InteractionModeSchema: Schema.Struct<{ mode: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; agentId: typeof Schema.String; sessionId: Schema.brand; startedAt: typeof Schema.DateFromSelf; metadata: Schema.optional>; }>; type InteractionMode = typeof InteractionModeSchema.Type; declare const NotificationChannel: Schema.Literal<["in-app", "callback", "event-bus"]>; type NotificationChannel = typeof NotificationChannel.Type; declare const NotificationPriority: Schema.Literal<["low", "normal", "high", "urgent"]>; type NotificationPriority = typeof NotificationPriority.Type; declare const NotificationSchema: Schema.Struct<{ id: typeof Schema.String; agentId: typeof Schema.String; channel: Schema.Literal<["in-app", "callback", "event-bus"]>; priority: Schema.Literal<["low", "normal", "high", "urgent"]>; title: typeof Schema.String; body: typeof Schema.String; data: Schema.optional; createdAt: typeof Schema.DateFromSelf; readAt: Schema.optional; }>; type Notification = typeof NotificationSchema.Type; declare const ReportingFrequency: Schema.Literal<["realtime", "milestone", "hourly", "daily"]>; type ReportingFrequency = typeof ReportingFrequency.Type; declare const ReportingDetailLevel: Schema.Literal<["minimal", "summary", "detailed"]>; type ReportingDetailLevel = typeof ReportingDetailLevel.Type; declare const ReportingConfigSchema: Schema.Struct<{ frequency: Schema.Literal<["realtime", "milestone", "hourly", "daily"]>; channel: Schema.Literal<["in-app", "callback", "event-bus"]>; detail: Schema.Literal<["minimal", "summary", "detailed"]>; streaming: typeof Schema.Boolean; }>; type ReportingConfig = typeof ReportingConfigSchema.Type; declare const EscalationConditionType: Schema.Literal<["uncertainty", "cost", "duration", "user-active", "confidence", "consecutive-approvals"]>; type EscalationConditionType = typeof EscalationConditionType.Type; declare const EscalationConditionSchema: Schema.Struct<{ type: Schema.Literal<["uncertainty", "cost", "duration", "user-active", "confidence", "consecutive-approvals"]>; threshold: typeof Schema.Number; }>; type EscalationCondition = typeof EscalationConditionSchema.Type; declare const ModeTransitionRuleSchema: Schema.Struct<{ from: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; to: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; conditions: Schema.Array$; threshold: typeof Schema.Number; }>>; }>; type ModeTransitionRule = typeof ModeTransitionRuleSchema.Type; declare const InteractionConfigSchema: Schema.Struct<{ defaultMode: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; interruptRules: Schema.Array$; severity: Schema.Literal<["low", "medium", "high", "critical"]>; threshold: Schema.optional; enabled: typeof Schema.Boolean; }>>; reporting: Schema.Struct<{ frequency: Schema.Literal<["realtime", "milestone", "hourly", "daily"]>; channel: Schema.Literal<["in-app", "callback", "event-bus"]>; detail: Schema.Literal<["minimal", "summary", "detailed"]>; streaming: typeof Schema.Boolean; }>; checkpoints: Schema.optional; intervalMs: Schema.optional; milestones: Schema.optional>; autoApprove: Schema.Struct<{ enabled: typeof Schema.Boolean; timeoutMs: typeof Schema.Number; defaultAction: Schema.Literal<["approve", "reject", "pause"]>; }>; }>>; escalationRules: Schema.Array$; to: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; conditions: Schema.Array$; threshold: typeof Schema.Number; }>>; }>>; deescalationRules: Schema.Array$; to: Schema.Literal<["autonomous", "supervised", "collaborative", "consultative", "interrogative"]>; conditions: Schema.Array$; threshold: typeof Schema.Number; }>>; }>>; learningEnabled: typeof Schema.Boolean; }>; type InteractionConfig = typeof InteractionConfigSchema.Type; declare const defaultInteractionConfig: InteractionConfig; declare const CheckpointStatus: Schema.Literal<["pending", "approved", "rejected", "auto-approved", "expired"]>; type CheckpointStatus = typeof CheckpointStatus.Type; declare const CheckpointSchema: Schema.Struct<{ id: typeof Schema.String; agentId: typeof Schema.String; taskId: typeof Schema.String; milestoneName: typeof Schema.String; description: typeof Schema.String; status: Schema.Literal<["pending", "approved", "rejected", "auto-approved", "expired"]>; createdAt: typeof Schema.DateFromSelf; resolvedAt: Schema.optional; userComment: Schema.optional; }>; type Checkpoint = typeof CheckpointSchema.Type; declare const CheckpointFrequency: Schema.Literal<["milestone", "time-based"]>; type CheckpointFrequency = typeof CheckpointFrequency.Type; declare const AutoApproveAction: Schema.Literal<["approve", "reject", "pause"]>; type AutoApproveAction = typeof AutoApproveAction.Type; declare const CheckpointConfigSchema: Schema.Struct<{ frequency: Schema.Literal<["milestone", "time-based"]>; intervalMs: Schema.optional; milestones: Schema.optional>; autoApprove: Schema.Struct<{ enabled: typeof Schema.Boolean; timeoutMs: typeof Schema.Number; defaultAction: Schema.Literal<["approve", "reject", "pause"]>; }>; }>; type CheckpointConfig = typeof CheckpointConfigSchema.Type; declare const InterruptTrigger: Schema.Literal<["error", "uncertainty", "high-cost", "critical-decision", "user-requested", "custom"]>; type InterruptTrigger = typeof InterruptTrigger.Type; declare const InterruptSeverity: Schema.Literal<["low", "medium", "high", "critical"]>; type InterruptSeverity = typeof InterruptSeverity.Type; declare const InterruptRuleSchema: Schema.Struct<{ trigger: Schema.Literal<["error", "uncertainty", "high-cost", "critical-decision", "user-requested", "custom"]>; severity: Schema.Literal<["low", "medium", "high", "critical"]>; threshold: Schema.optional; enabled: typeof Schema.Boolean; }>; type InterruptRule = typeof InterruptRuleSchema.Type; declare const InterruptEventSchema: Schema.Struct<{ id: typeof Schema.String; trigger: Schema.Literal<["error", "uncertainty", "high-cost", "critical-decision", "user-requested", "custom"]>; severity: Schema.Literal<["low", "medium", "high", "critical"]>; agentId: typeof Schema.String; taskId: typeof Schema.String; message: typeof Schema.String; context: Schema.optional; timestamp: typeof Schema.DateFromSelf; acknowledged: typeof Schema.Boolean; }>; type InterruptEvent = typeof InterruptEventSchema.Type; declare const CollaborationStatus: Schema.Literal<["active", "paused", "ended"]>; type CollaborationStatus = typeof CollaborationStatus.Type; declare const QuestionStyle: Schema.Literal<["inline", "batch", "separate"]>; type QuestionStyle = typeof QuestionStyle.Type; declare const CollaborationSessionSchema: Schema.Struct<{ id: Schema.brand; agentId: typeof Schema.String; taskId: typeof Schema.String; status: Schema.Literal<["active", "paused", "ended"]>; thinkingVisible: typeof Schema.Boolean; streamingEnabled: typeof Schema.Boolean; questionStyle: Schema.Literal<["inline", "batch", "separate"]>; rollbackEnabled: typeof Schema.Boolean; startedAt: typeof Schema.DateFromSelf; endedAt: Schema.optional; }>; type CollaborationSession = typeof CollaborationSessionSchema.Type; declare const CollaborationMessageType: Schema.Literal<["thought", "question", "answer", "suggestion", "update", "action"]>; type CollaborationMessageType = typeof CollaborationMessageType.Type; declare const CollaborationMessageSchema: Schema.Struct<{ id: typeof Schema.String; sessionId: Schema.brand; type: Schema.Literal<["thought", "question", "answer", "suggestion", "update", "action"]>; sender: Schema.Literal<["agent", "user"]>; content: typeof Schema.String; timestamp: typeof Schema.DateFromSelf; }>; type CollaborationMessage = typeof CollaborationMessageSchema.Type; declare const ApprovalAction: Schema.Literal<["auto-approve", "auto-reject", "ask"]>; type ApprovalAction = typeof ApprovalAction.Type; declare const ApprovalPatternSchema: Schema.Struct<{ id: typeof Schema.String; taskType: typeof Schema.String; costThreshold: Schema.optional; action: Schema.Literal<["auto-approve", "auto-reject", "ask"]>; confidence: typeof Schema.Number; occurrences: typeof Schema.Number; lastSeen: typeof Schema.DateFromSelf; }>; type ApprovalPattern = typeof ApprovalPatternSchema.Type; declare const InterruptionTolerance: Schema.Literal<["low", "medium", "high"]>; type InterruptionTolerance = typeof InterruptionTolerance.Type; declare const UserPreferenceSchema: Schema.Struct<{ userId: typeof Schema.String; learningEnabled: typeof Schema.Boolean; interruptionTolerance: Schema.Literal<["low", "medium", "high"]>; preferredMode: Schema.optional; approvalPatterns: Schema.Array$; action: Schema.Literal<["auto-approve", "auto-reject", "ask"]>; confidence: typeof Schema.Number; occurrences: typeof Schema.Number; lastSeen: typeof Schema.DateFromSelf; }>>; lastUpdated: typeof Schema.DateFromSelf; }>; type UserPreference = typeof UserPreferenceSchema.Type; declare const InteractionError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "InteractionError"; } & Readonly; declare class InteractionError extends InteractionError_base<{ readonly message: string; readonly cause?: unknown; }> { } declare const ModeError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "ModeError"; } & Readonly; declare class ModeError extends ModeError_base<{ readonly from: string; readonly to: string; readonly reason: string; }> { } declare const CheckpointError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "CheckpointError"; } & Readonly; declare class CheckpointError extends CheckpointError_base<{ readonly checkpointId: string; readonly message: string; }> { } declare const SessionNotFoundError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "SessionNotFoundError"; } & Readonly; declare class SessionNotFoundError extends SessionNotFoundError_base<{ readonly sessionId: string; }> { } declare const NotificationError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "NotificationError"; } & Readonly; declare class NotificationError extends NotificationError_base<{ readonly channel: string; readonly message: string; readonly cause?: unknown; }> { } declare const InputTimeoutError_base: new = {}>(args: effect_Types.Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & { readonly _tag: "InputTimeoutError"; } & Readonly; declare class InputTimeoutError extends InputTimeoutError_base<{ readonly timeoutMs: number; readonly message: string; }> { } type InteractionErrors = InteractionError | ModeError | CheckpointError | SessionNotFoundError | NotificationError | InputTimeoutError; declare const ModeSwitcher_base: Context.TagClass Effect.Effect; readonly setMode: (agentId: string, targetMode: InteractionModeType) => Effect.Effect; readonly evaluateTransition: (agentId: string, context: { confidence?: number; cost?: number; durationMs?: number; userActive?: boolean; consecutiveApprovals?: number; }) => Effect.Effect; }>; declare class ModeSwitcher extends ModeSwitcher_base { } declare const ModeSwitcherLive: (config?: InteractionConfig) => Layer.Layer; declare const NotificationService_base: Context.TagClass Effect.Effect; /** List unread notifications. */ readonly listUnread: () => Effect.Effect; /** Mark a notification as read. */ readonly markRead: (notificationId: string) => Effect.Effect; }>; declare class NotificationService extends NotificationService_base { } declare const NotificationServiceLive: Layer.Layer; declare const CheckpointService_base: Context.TagClass Effect.Effect; readonly resolveCheckpoint: (checkpointId: string, status: "approved" | "rejected", comment?: string) => Effect.Effect; readonly getCheckpoint: (checkpointId: string) => Effect.Effect; readonly listPending: (agentId?: string) => Effect.Effect; }>; declare class CheckpointService extends CheckpointService_base { } declare const CheckpointServiceLive: Layer.Layer; declare const CollaborationService_base: Context.TagClass Effect.Effect; readonly endSession: (sessionId: SessionId) => Effect.Effect; readonly sendMessage: (params: { sessionId: SessionId; type: CollaborationMessage["type"]; sender: "agent" | "user"; content: string; }) => Effect.Effect; readonly getMessages: (sessionId: SessionId) => Effect.Effect; readonly getSession: (sessionId: SessionId) => Effect.Effect; }>; declare class CollaborationService extends CollaborationService_base { } declare const CollaborationServiceLive: Layer.Layer; declare const PreferenceLearner_base: Context.TagClass Effect.Effect; readonly recordApproval: (params: { userId: string; taskType: string; approved: boolean; cost?: number; }) => Effect.Effect; readonly shouldAutoApprove: (params: { userId: string; taskType: string; cost?: number; }) => Effect.Effect; readonly updateTolerance: (userId: string, tolerance: "low" | "medium" | "high") => Effect.Effect; }>; declare class PreferenceLearner extends PreferenceLearner_base { } declare const PreferenceLearnerLive: Layer.Layer; interface ApprovalResult { readonly approved: boolean; readonly reason?: string; readonly timedOut?: boolean; } declare const InteractionManager_base: Context.TagClass Effect.Effect; readonly switchMode: (agentId: string, mode: InteractionModeType) => Effect.Effect; readonly evaluateTransition: (agentId: string, context: { confidence?: number; cost?: number; durationMs?: number; userActive?: boolean; consecutiveApprovals?: number; }) => Effect.Effect; readonly notify: (params: { readonly agentId: string; readonly channel: NotificationChannel; readonly priority: NotificationPriority; readonly title: string; readonly body: string; }) => Effect.Effect; readonly listUnread: () => Effect.Effect; readonly markRead: (notificationId: string) => Effect.Effect; readonly createCheckpoint: (params: { agentId: string; taskId: string; milestoneName: string; description: string; }) => Effect.Effect; readonly resolveCheckpoint: (checkpointId: string, status: "approved" | "rejected", comment?: string) => Effect.Effect; readonly listPendingCheckpoints: (agentId?: string) => Effect.Effect; readonly startCollaboration: (params: { agentId: string; taskId: string; thinkingVisible?: boolean; }) => Effect.Effect; readonly endCollaboration: (sessionId: SessionId) => Effect.Effect; readonly sendCollaborationMessage: (params: { sessionId: SessionId; type: CollaborationMessage["type"]; sender: "agent" | "user"; content: string; }) => Effect.Effect; readonly getPreference: (userId: string) => Effect.Effect; readonly shouldAutoApprove: (params: { userId: string; taskType: string; cost?: number; }) => Effect.Effect; readonly approvalGate: (action: string, timeoutMs?: number) => Effect.Effect; readonly resolveApproval: (gateId: string, approved: boolean, reason?: string) => Effect.Effect; }>; declare class InteractionManager extends InteractionManager_base { } declare const InteractionManagerLive: Layer.Layer; /** * Create the Interaction layer (Phase 3 — all 5 modes). * * Provides: InteractionManager, ModeSwitcher, NotificationService, * CheckpointService, CollaborationService, PreferenceLearner * Requires: EventBus (from @reactive-agents/core) */ declare const createInteractionLayer: (config?: InteractionConfig) => Layer.Layer; export { ApprovalAction, type ApprovalPattern, ApprovalPatternSchema, type ApprovalResult, AutoApproveAction, type Checkpoint, type CheckpointConfig, CheckpointConfigSchema, CheckpointError, CheckpointFrequency, CheckpointSchema, CheckpointService, CheckpointServiceLive, CheckpointStatus, type CollaborationMessage, CollaborationMessageSchema, CollaborationMessageType, CollaborationService, CollaborationServiceLive, type CollaborationSession, CollaborationSessionSchema, CollaborationStatus, type EscalationCondition, EscalationConditionSchema, EscalationConditionType, InputTimeoutError, type InteractionConfig, InteractionConfigSchema, InteractionError, type InteractionErrors, InteractionManager, InteractionManagerLive, type InteractionMode, InteractionModeSchema, InteractionModeType, type InterruptEvent, InterruptEventSchema, type InterruptRule, InterruptRuleSchema, InterruptSeverity, InterruptTrigger, InterruptionTolerance, ModeError, ModeSwitcher, ModeSwitcherLive, type ModeTransitionRule, ModeTransitionRuleSchema, type Notification, NotificationChannel, NotificationError, NotificationPriority, NotificationSchema, NotificationService, NotificationServiceLive, PreferenceLearner, PreferenceLearnerLive, QuestionStyle, type ReportingConfig, ReportingConfigSchema, ReportingDetailLevel, ReportingFrequency, SessionId, SessionNotFoundError, type UserPreference, UserPreferenceSchema, createInteractionLayer, defaultInteractionConfig };