/** * Context Synchronization Types */ /** * Context scope levels */ export declare enum ContextScope { GLOBAL = "global",// Shared across all projects PROJECT = "project",// Shared within a project TASK = "task",// Shared within a task group TERMINAL = "terminal" } /** * Context entry types */ export declare enum ContextType { CODE = "code",// Code snippets and implementations SCHEMA = "schema",// Data structures and schemas API = "api",// API definitions and endpoints CONFIG = "config",// Configuration values STATE = "state",// Application state DECISION = "decision",// Design decisions and rationale ERROR = "error",// Error patterns and solutions DEPENDENCY = "dependency",// External dependencies DOCUMENTATION = "documentation",// Documentation snippets TEST = "test" } /** * Context entry */ export interface ContextEntry { id: string; key: string; value: any; type: ContextType; scope: ContextScope; projectId?: string; taskId?: string; terminalId?: string; version: number; createdAt: Date; updatedAt: Date; createdBy: string; updatedBy: string; metadata?: ContextMetadata; ttl?: number; locked?: boolean; checksum?: string; } /** * Context metadata */ export interface ContextMetadata { description?: string; tags?: string[]; category?: string; priority?: number; confidence?: number; source?: string; references?: string[]; dependencies?: string[]; language?: string; framework?: string; } /** * Context update */ export interface ContextUpdate { entryId: string; key: string; value: any; operation: UpdateOperation; terminalId: string; timestamp: Date; version: number; delta?: any; } /** * Update operations */ export declare enum UpdateOperation { SET = "set", MERGE = "merge", DELETE = "delete", APPEND = "append", INCREMENT = "increment", DECREMENT = "decrement" } /** * Context query */ export interface ContextQuery { scope?: ContextScope; type?: ContextType; projectId?: string; taskId?: string; terminalId?: string; keys?: string[]; tags?: string[]; since?: Date; limit?: number; includeMetadata?: boolean; } /** * Context snapshot */ export interface ContextSnapshot { id: string; timestamp: Date; entries: ContextEntry[]; version: number; checksum: string; size: number; } /** * Context diff */ export interface ContextDiff { added: ContextEntry[]; modified: ContextEntry[]; deleted: string[]; fromVersion: number; toVersion: number; timestamp: Date; } /** * Sync message */ export interface SyncMessage { type: SyncMessageType; terminalId: string; timestamp: Date; payload: any; sequenceNumber: number; } /** * Sync message types */ export declare enum SyncMessageType { SUBSCRIBE = "subscribe", UNSUBSCRIBE = "unsubscribe", UPDATE = "update", BATCH_UPDATE = "batch_update", REQUEST_SYNC = "request_sync", SYNC_RESPONSE = "sync_response", CONFLICT = "conflict", ACK = "ack", HEARTBEAT = "heartbeat" } /** * Sync subscription */ export interface SyncSubscription { terminalId: string; query: ContextQuery; subscribedAt: Date; lastSyncVersion: number; lastSyncTime: Date; active: boolean; } /** * Conflict resolution strategy */ export declare enum ConflictResolution { LAST_WRITE_WINS = "last_write_wins", FIRST_WRITE_WINS = "first_write_wins", MERGE = "merge", MANUAL = "manual", TERMINAL_PRIORITY = "terminal_priority" } /** * Context conflict */ export interface ContextConflict { entryId: string; key: string; localValue: any; remoteValue: any; localVersion: number; remoteVersion: number; localTerminal: string; remoteTerminal: string; timestamp: Date; resolution?: ConflictResolution; resolvedValue?: any; resolvedBy?: string; resolvedAt?: Date; } /** * Context store configuration */ export interface ContextStoreConfig { maxEntriesPerScope: number; maxEntrySize: number; defaultTTL: number; conflictResolution: ConflictResolution; syncInterval: number; compressionEnabled: boolean; encryptionEnabled: boolean; persistenceEnabled: boolean; cachingEnabled: boolean; validationEnabled: boolean; } /** * Context statistics */ export interface ContextStatistics { totalEntries: number; entriesByScope: Map; entriesByType: Map; totalSize: number; averageEntrySize: number; oldestEntry: Date; newestEntry: Date; updateRate: number; conflictRate: number; syncLatency: number; activeSubscriptions: number; } /** * Context validation rule */ export interface ValidationRule { type: ContextType; scope: ContextScope; validator: (value: any) => boolean; errorMessage: string; } /** * Context transformer */ export interface ContextTransformer { type: ContextType; transform: (value: any, direction: 'in' | 'out') => any; } /** * Context event */ export interface ContextEvent { type: ContextEventType; entry?: ContextEntry; update?: ContextUpdate; conflict?: ContextConflict; error?: Error; timestamp: Date; } /** * Context event types */ export declare enum ContextEventType { ENTRY_ADDED = "entry_added", ENTRY_UPDATED = "entry_updated", ENTRY_DELETED = "entry_deleted", CONFLICT_DETECTED = "conflict_detected", CONFLICT_RESOLVED = "conflict_resolved", SYNC_STARTED = "sync_started", SYNC_COMPLETED = "sync_completed", SYNC_FAILED = "sync_failed", SNAPSHOT_CREATED = "snapshot_created", SNAPSHOT_RESTORED = "snapshot_restored" } /** * Context access control */ export interface ContextAccessControl { entryId: string; readTerminals: string[]; writeTerminals: string[]; deleteTerminals: string[]; owner: string; public: boolean; } /** * Context index */ export interface ContextIndex { key: string; type: 'hash' | 'btree' | 'text'; unique: boolean; sparse: boolean; } //# sourceMappingURL=types.d.ts.map