import * as i0 from '@angular/core'; import { InjectionToken, OnDestroy, ElementRef, AfterViewInit, OnChanges, EventEmitter, SimpleChanges, OnInit, ChangeDetectorRef } from '@angular/core'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; import { PraxisRuntimeComponentObservationEnvelope, PraxisRuntimeComponentObservationRegistryService } from '@praxisui/core'; import { Schema } from '@google/generative-ai'; import { ConnectedPosition, CdkOverlayOrigin } from '@angular/cdk/overlay'; import * as _praxisui_ai from '@praxisui/ai'; import { MatDialogRef } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; declare class PraxisAi { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Generated from praxis-config-starter/docs/ai/contracts/praxis-ai-api-contract-v1.1.openapi.yaml. * Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js. */ declare const AI_CONTRACT_VERSION: "v1.1"; declare const AI_CONTRACT_SCHEMA_HASH: "d817fcf351207371c5cb8528b70c0ba6830648710581b08c7cc2b2b428989289"; declare const AI_STREAM_EVENT_SCHEMA_VERSION: "v1"; declare const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION: "praxis.ai.context-hints.domain-catalog/v0.2"; declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "intent.resolved", "result", "error", "cancelled"]; type AiJsonPrimitive = string | number | boolean | null; type AiJsonArray = AiJsonValue[]; interface AiJsonObject { [key: string]: AiJsonValue; } type AiJsonValue = AiJsonPrimitive | AiJsonObject | AiJsonArray; type AiDomainCatalogContextHintItemType = 'context' | 'node' | 'edge' | 'binding' | 'evidence' | 'governance' | 'vocabulary' | 'relationship'; type AiDomainCatalogContextHintIntent = 'authoring' | 'explain' | 'validate' | 'ai-access-control'; type AiDomainCatalogRecommendedAuthoringFlow = 'shared_rule_authoring' | 'component_authoring' | 'ui_composition_authoring'; type AiDomainCatalogRecommendedRuleType = 'privacy' | 'compliance' | 'validation' | 'selection_eligibility' | 'workflow_action_policy' | 'approval_policy' | string; interface AiDomainCatalogRelationshipHintContract { enabled?: boolean; federated?: boolean; serviceKey?: string | null; sourceNodeKey?: string | null; targetNodeKey?: string | null; edgeType?: string | null; query?: string | null; limit?: number; } interface AiDomainCatalogContextHintContract { schemaVersion?: typeof AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION; serviceKey?: string; resourceKey?: string | null; releaseId?: string | null; releaseKey?: string | null; type?: AiDomainCatalogContextHintItemType; itemTypes?: AiDomainCatalogContextHintItemType[]; intent?: AiDomainCatalogContextHintIntent | null; query?: string | null; contextKey?: string | null; nodeType?: string | null; recommendedAuthoringFlow?: AiDomainCatalogRecommendedAuthoringFlow | null; recommendedRuleType?: AiDomainCatalogRecommendedRuleType | null; limit?: number; relationships?: AiDomainCatalogRelationshipHintContract | null; } interface AgenticAuthoringApplyTargetBaseContract { schemaVersion: 'praxis-agentic-authoring-apply-target.v1'; componentType: string; componentId: string; scope: 'user' | 'tenant'; environment?: string | null; } type AgenticAuthoringApplyTargetContract = AgenticAuthoringApplyTargetBaseContract & ({ mode: 'create'; baseEtag?: never; } | { mode: 'update'; baseEtag: string; }); interface AiContextHintsContract { domainCatalog?: AiDomainCatalogContextHintContract; [key: string]: AiJsonValue | AiDomainCatalogContextHintContract | undefined; } interface AgenticAuthoringClientActionContract { schemaVersion: 'praxis-agentic-authoring-client-action.v1'; id: string; kind: 'local-undo'; capabilityRef: string; available: boolean; targetComponentId?: string | null; } interface AgenticAuthoringTurnStreamContextHintsContract { domainCatalog?: AiDomainCatalogContextHintContract; agenticApplyTarget?: AgenticAuthoringApplyTargetContract; clientActions?: AgenticAuthoringClientActionContract[]; [key: string]: AiJsonValue | AiDomainCatalogContextHintContract | AgenticAuthoringApplyTargetContract | AgenticAuthoringClientActionContract[] | undefined; } interface AiSchemaContextContract { path?: string | null; operation?: string | null; schemaType?: string | null; } interface AiChatMessageContract { role: 'user' | 'assistant' | 'system'; content: string; } interface AiUiContextRefContract { componentType?: string | null; componentId?: string | null; routeKey?: string | null; schemaHash?: string | null; variantId?: string | null; } interface AiCurrentStateDigestContract { columns?: string[] | null; sort?: string | null; rowCount?: number | null; } interface AiOrchestratorRequestContract { componentId: string; componentType: string; userPrompt?: string; sessionId?: string; mode?: 'new' | 'continue'; clientTurnId?: string; messages?: AiChatMessageContract[]; summary?: string; uiContextRef?: AiUiContextRefContract; currentStateDigest?: AiCurrentStateDigestContract; currentState: AiJsonObject; dataProfile?: AiJsonObject | null; schemaFields?: AiJsonObject[] | null; runtimeState?: AiJsonObject | null; suggestedPatch?: AiJsonObject | null; contextHints?: AiContextHintsContract | null; aiMode?: string; requireSchema?: boolean; resourcePath?: string; contractVersion?: string; schemaHash?: string; schemaContext?: AiSchemaContextContract | null; variantId?: string; apiMethod?: string; apiTags?: string; apiSearchLimit?: number; observationId?: string; } type AiOrchestratorResponseType = 'patch' | 'clarification' | 'error' | 'info'; interface AiPatchDiffContract { path: string; before?: AiJsonValue; after?: AiJsonValue; } interface AiOptionContract { value?: string | null; label?: string | null; example?: string | null; contextHints?: AiContextHintsContract | null; } interface AiClarificationUiContract { responseType?: 'text' | 'choice' | 'confirm' | 'mixed' | 'context'; selectionMode?: 'single' | 'multiple'; presentation?: 'buttons' | 'list' | 'chips'; allowCustom?: boolean | null; } interface AiMemoryInfoContract { summaryUpdated?: boolean | null; windowSize?: number | null; cached?: boolean | null; } interface AiOrchestratorResponseContract { sessionId?: string | null; code?: string | null; type?: AiOrchestratorResponseType; contractVersion?: string | null; schemaHash?: string | null; patch?: AiJsonObject | null; componentEditPlan?: AiJsonObject | null; diff?: AiPatchDiffContract[] | null; explanation?: string | null; warnings?: string[] | null; message?: string | null; options?: string[] | null; optionPayloads?: AiOptionContract[] | null; contextRequest?: number[] | null; clarification?: AiClarificationUiContract; componentId?: string | null; componentType?: string | null; path?: string | null; providedValue?: AiJsonValue; allowedValues?: string[] | null; memory?: AiMemoryInfoContract; observationId?: string | null; } type AiAssistantObservationFeedbackRating = 'positive' | 'negative' | 'inaccurate' | 'unsafe' | 'irrelevant' | 'incomplete'; interface AiAssistantObservationFeedbackRequestContract { rating?: AiAssistantObservationFeedbackRating; reasonCode?: string | null; comment?: string | null; } interface AiAssistantObservationFeedbackResponseContract { feedbackId?: string | null; observationId?: string | null; rating?: string | null; reasonCode?: string | null; commentPreview?: string | null; createdAt?: string | null; } interface AiAssistantObservationResponseContract { observationId?: string | null; requestId?: string | null; tenantId?: string | null; environment?: string | null; userId?: string | null; surface?: string | null; componentId?: string | null; componentType?: string | null; routeKey?: string | null; variantId?: string | null; schemaHash?: string | null; contractVersion?: string | null; sessionId?: string | null; clientTurnId?: string | null; threadId?: string | null; turnId?: string | null; streamId?: string | null; promptHash?: string | null; promptPreview?: string | null; promptLength?: number | null; admissionOutcome?: string | null; terminalOutcome?: string | null; qualityOutcome?: string | null; errorCategory?: string | null; errorCode?: string | null; errorMessagePreview?: string | null; provider?: string | null; model?: string | null; llmCallCount?: number | null; latencyMs?: number | null; createdAt?: string | null; updatedAt?: string | null; feedback?: AiAssistantObservationFeedbackResponseContract[]; } interface AiAssistantObservationSummaryRowContract { admissionOutcome?: string | null; terminalOutcome?: string | null; qualityOutcome?: string | null; componentId?: string | null; componentType?: string | null; total?: number | null; } interface AiAssistantObservationSummaryResponseContract { rows?: AiAssistantObservationSummaryRowContract[]; } interface AgenticAuthoringConversationMessageContract { id?: string | null; role: 'user' | 'assistant' | 'system'; text?: string | null; createdAt?: string | null; } interface AgenticAuthoringPendingClarificationContract { sourcePrompt?: string | null; questions?: string[]; assistantMessage?: string | null; clientTurnId?: string | null; diagnostics?: AiJsonObject | null; } interface AgenticAuthoringAttachmentSummaryContract { id: string; name: string; kind: string; mimeType?: string | null; sizeBytes?: number | null; source?: string | null; hasPreview?: boolean; } interface AgenticAuthoringConversationContextContract { sessionId?: string | null; clientTurnId?: string | null; conversationMessages?: AgenticAuthoringConversationMessageContract[]; pendingClarification?: AgenticAuthoringPendingClarificationContract | null; attachmentSummaries?: AgenticAuthoringAttachmentSummaryContract[]; } interface AgenticAuthoringIntentResolutionRequestContract extends AgenticAuthoringConversationContextContract { userPrompt: string; targetApp?: string | null; targetComponentId?: string | null; currentRoute?: string | null; currentPage?: AiJsonObject | null; selectedWidgetKey?: string | null; provider?: string | null; model?: string | null; apiKey?: string | null; contextHints?: AiContextHintsContract | null; } interface AgenticAuthoringCandidateContract { resourcePath?: string | null; operation?: string | null; schemaUrl?: string | null; submitUrl?: string | null; submitMethod?: string | null; score?: number | null; reason?: string | null; evidence?: string[] | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringQuickReplyContract { id: string; kind: string; label: string; prompt: string; description?: string | null; icon?: string | null; tone?: string | null; contextHints?: AiContextHintsContract | null; semanticDecision?: AgenticAuthoringSemanticDecisionContract | null; value?: AiJsonObject | AiJsonValue | null; [key: string]: AiJsonValue | AiContextHintsContract | AgenticAuthoringSemanticDecisionContract | null | undefined; } interface AgenticAuthoringSemanticSelectedResourceContract { resourcePath?: string | null; operation?: string | null; schemaUrl?: string | null; submitUrl?: string | null; submitMethod?: string | null; label?: string | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringSemanticRetrievalEvidenceContract { retrievalSource?: string | null; evidence?: string[]; candidateCount?: number; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringEvidenceBundleEvidenceContract { source?: string | null; kind?: string | null; ref?: string | null; summary?: string | null; confidence?: number | null; matchedTerms?: string[]; tenantId?: string | null; environment?: string | null; releaseId?: string | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringEvidenceBundleContract { schemaVersion?: string | null; retrievalSource?: string | null; evidence?: AgenticAuthoringEvidenceBundleEvidenceContract[]; evidenceCount?: number; [key: string]: AiJsonValue | AgenticAuthoringEvidenceBundleEvidenceContract[] | undefined; } interface AgenticAuthoringSemanticRefinementContract { schemaVersion?: string | null; refinementKind?: 'visual_projection' | 'data_source' | 'filtering' | 'layout' | 'metric' | 'copy' | 'governance' | string | null; preserve?: string[]; replace?: Record; add?: Record; remove?: string[]; rationale?: string | null; confidence?: number | null; [key: string]: AiJsonValue | Record | Record | undefined; } interface AgenticAuthoringSemanticDecisionContract { schemaVersion?: string | null; decisionId?: string | null; operationKind?: string | null; artifactKind?: string | null; changeKind?: string | null; selectedResource?: AgenticAuthoringSemanticSelectedResourceContract | null; visualizationDecision?: AgenticAuthoringVisualizationDecisionContract | null; retrievalEvidence?: AgenticAuthoringSemanticRetrievalEvidenceContract | null; retrievedEvidence?: AgenticAuthoringEvidenceBundleContract | null; reviewRequired?: boolean | null; reviewReason?: string | null; previousDecisionRef?: string | null; refinementOf?: string | null; conversationId?: string | null; turnId?: string | null; userGoal?: string | null; activeObjective?: string | null; artifactIntent?: string | null; visualIntent?: string | null; constraints?: AiJsonObject | null; refinement?: AgenticAuthoringSemanticRefinementContract | null; previousDecisionId?: string | null; rationale?: string | null; confidence?: number | null; [key: string]: AiJsonValue | AgenticAuthoringSemanticSelectedResourceContract | AgenticAuthoringSemanticRetrievalEvidenceContract | AgenticAuthoringEvidenceBundleContract | AgenticAuthoringSemanticRefinementContract | AgenticAuthoringVisualizationDecisionContract | undefined; } interface AgenticAuthoringIntentResolutionResultContract { valid?: boolean; operationKind?: string | null; artifactKind?: string | null; changeKind?: string | null; selectedCandidate?: AgenticAuthoringCandidateContract | null; candidates?: AgenticAuthoringCandidateContract[]; gate?: AiJsonObject | null; effectivePrompt?: string | null; assistantMessage?: string | null; assistantContent?: AiJsonObject | null; quickReplies?: AgenticAuthoringQuickReplyContract[]; pendingClarification?: AgenticAuthoringPendingClarificationContract | null; clarificationQuestions?: string[]; warnings?: string[]; failureCodes?: string[]; llmDiagnostics?: AiJsonObject | null; semanticDecision?: AgenticAuthoringSemanticDecisionContract | null; visualizationDecision?: AgenticAuthoringVisualizationDecisionContract | null; [key: string]: AiJsonValue | AgenticAuthoringCandidateContract | AgenticAuthoringCandidateContract[] | AgenticAuthoringQuickReplyContract | AgenticAuthoringQuickReplyContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringSemanticDecisionContract | AgenticAuthoringVisualizationDecisionContract | undefined; } interface AgenticAuthoringVisualizationAxisDecisionContract { concept?: string | null; field?: string | null; label?: string | null; chartType?: string | null; orientation?: string | null; metricAggregation?: string | null; metricField?: string | null; metricLabel?: string | null; provenance?: string | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringVisualizationDecisionContract { schemaVersion?: string | null; intent?: string | null; layoutKind?: string | null; primaryComponent?: string | null; axes?: AgenticAuthoringVisualizationAxisDecisionContract[]; includeSummary?: boolean | null; includeDetailTable?: boolean | null; excludedComponentIds?: string[]; includeFilters?: boolean | null; includeKpis?: boolean | null; provenance?: string | null; [key: string]: AiJsonValue | AgenticAuthoringVisualizationAxisDecisionContract[] | string[] | undefined; } interface AgenticAuthoringResourceCandidatesRequestContract { retrievalQuery?: string | null; userPrompt?: string | null; artifactKind?: string | null; limit?: number | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringResourceCandidatesResultContract { valid?: boolean; tool?: string | null; retrievalQuery?: string | null; artifactKind?: string | null; assistantMessage?: string | null; assistantContent?: AiJsonObject | null; candidates?: AgenticAuthoringCandidateContract[]; quickReplies?: AgenticAuthoringQuickReplyContract[]; warnings?: string[]; [key: string]: AiJsonValue | AgenticAuthoringCandidateContract[] | AgenticAuthoringQuickReplyContract[] | undefined; } interface AgenticAuthoringPlanRequestContract extends AgenticAuthoringConversationContextContract { userPrompt: string; provider?: string | null; model?: string | null; apiKey?: string | null; currentPage?: AiJsonObject | null; intentResolution?: AgenticAuthoringIntentResolutionResultContract | null; contextHints?: AiContextHintsContract | null; } interface AgenticAuthoringTurnStreamRequestContract extends AgenticAuthoringConversationContextContract { userPrompt: string; targetApp?: string | null; targetComponentId?: string | null; currentRoute?: string | null; currentPage?: AiJsonObject | null; selectedWidgetKey?: string | null; provider?: string | null; model?: string | null; apiKey?: string | null; contextHints?: AgenticAuthoringTurnStreamContextHintsContract | null; componentCapabilities?: AgenticAuthoringComponentCapabilitiesResultContract | null; activeSemanticDecision?: AgenticAuthoringSemanticDecisionContract | null; diagnostics?: AiJsonObject | null; runtimeComponentObservations?: unknown[] | null; runtimeComponentObservationTrustBoundary?: 'untrusted_frontend_observation' | null; [key: string]: AiJsonValue | AgenticAuthoringTurnStreamContextHintsContract | AgenticAuthoringComponentCapabilitiesResultContract | AgenticAuthoringSemanticDecisionContract | AgenticAuthoringConversationMessageContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringAttachmentSummaryContract[] | unknown[] | undefined; } interface AgenticAuthoringPreviewResultContract { valid?: boolean; warnings?: string[]; minimalFormPlan?: AiJsonObject | null; compiledFormPatch?: AiJsonObject | null; uiCompositionPlan?: AiJsonObject | null; diagnostics?: AiJsonObject | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringApplyRequestContract { componentType: string; componentId: string; streamId: string; resultEventId: string; scope?: string | null; compiledFormPatch: AiJsonObject; tags?: AiJsonObject | null; semanticDecision: AgenticAuthoringSemanticDecisionContract; [key: string]: AiJsonValue | AgenticAuthoringSemanticDecisionContract | undefined; } interface AgenticAuthoringApplyResultContract { applied?: boolean; etag?: string | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringComponentFieldAliasContract { field?: string | null; aliases?: string[]; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringComponentCapabilityExampleContract { prompt?: string | null; intent?: string | null; configHints?: string[]; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringComponentCapabilityContract { id?: string | null; changeKind?: string | null; triggerTerms?: string[]; fieldAliases?: AgenticAuthoringComponentFieldAliasContract[]; examples?: AgenticAuthoringComponentCapabilityExampleContract[]; [key: string]: AiJsonValue | AgenticAuthoringComponentFieldAliasContract[] | AgenticAuthoringComponentCapabilityExampleContract[] | undefined; } interface AgenticAuthoringComponentCapabilityCatalogContract { componentId?: string | null; version?: string | null; capabilities?: AgenticAuthoringComponentCapabilityContract[]; [key: string]: AiJsonValue | AgenticAuthoringComponentCapabilityContract[] | undefined; } interface AgenticAuthoringComponentCapabilityDiagnosticsContract { source?: 'registry' | 'last-known-good' | 'built-in-fallback' | 'built-in' | null; degraded?: boolean | null; degradationReason?: string | null; resolvedAt?: string | null; lastSuccessfulRegistryLoadAt?: string | null; [key: string]: AiJsonValue | undefined; } interface AgenticAuthoringComponentCapabilitiesResultContract { version?: string | null; catalogs?: AgenticAuthoringComponentCapabilityCatalogContract[]; diagnostics?: AgenticAuthoringComponentCapabilityDiagnosticsContract | null; [key: string]: AiJsonValue | AgenticAuthoringComponentCapabilityCatalogContract[] | AgenticAuthoringComponentCapabilityDiagnosticsContract | undefined; } interface AgenticAuthoringManifestEditPlanRequestContract { config?: AiJsonObject | null; plan?: AiJsonObject | null; validationContext?: AiJsonObject | null; } interface AgenticAuthoringResolveTargetRequestContract { config?: AiJsonObject | null; operationId?: string | null; target?: AiJsonValue; input?: AiJsonValue; } interface AgenticAuthoringResolvedTargetContract { status?: string | null; componentId?: string | null; operationId?: string | null; kind?: string | null; resolver?: string | null; path?: string | null; value?: AiJsonValue; candidates?: string[]; failures?: string[]; } interface AgenticAuthoringManifestValidationResultContract { valid?: boolean; failures?: string[]; warnings?: string[]; normalizedPlan?: AiJsonObject | null; } interface AgenticAuthoringManifestCompileResultContract { compiled?: boolean; failures?: string[]; warnings?: string[]; patch?: AiJsonObject | null; } interface AiPatchStreamStartResponseContract { streamId: string; threadId: string; turnId: string; eventSchemaVersion: string; streamAuthMode?: 'cookie' | 'signed_url_token' | null; streamAccessToken?: string | null; observationId?: string | null; expiresAt: string; fallbackPatchUrl: string; } interface AgenticAuthoringTurnStreamStartResponseContract { streamId: string; threadId: string; turnId: string; eventSchemaVersion: string; streamAuthMode?: 'cookie' | 'signed_url_token' | null; streamAccessToken?: string | null; observationId?: string | null; expiresAt: string; fallbackAuthoringUrl: string; } interface AiPatchStreamCancelResponseContract { streamId?: string | null; threadId?: string | null; turnId?: string | null; terminalState: 'cancelled' | 'completed' | 'not_found'; message?: string | null; } interface AiPatchStreamEnvelopeContract { eventId?: string | null; streamId: string; threadId: string; turnId: string; seq: number; eventSchemaVersion: string; timestamp: string; type: AiPatchStreamEventType$1; payload: TPayload; } interface AgenticAuthoringTurnStreamEnvelopeContract extends AiPatchStreamEnvelopeContract { } interface ProblemResponseContract { timestamp?: string | null; status?: number | null; error?: string | null; message?: string | null; path?: string | null; detail?: string | null; [key: string]: AiJsonValue | undefined; } type AiPatchStreamEventType$1 = (typeof AI_STREAM_EVENT_TYPES)[number]; type AiTurnStreamEventType = (typeof AI_STREAM_EVENT_TYPES)[number]; /** * Models for Praxis AI (Centralized) */ /** * Response structure expected from the AI model */ interface AiRuleResponse { /** Descriptive name for the rule */ ruleName: string; /** Type of target (scope) */ targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock'; /** IDs of the target elements */ targetIds: string[]; /** Canonical JSON Logic condition payload or null for always applied */ condition: AiJsonObject | null; /** Effects to apply */ effects: { /** Properties to apply when condition is true */ properties?: Record; /** Properties to apply when condition is false (else) */ propertiesWhenFalse?: Record; }; } /** * Minified field representation for AI context (token optimization) */ interface MinifiedField { id: string; label: string; type: string; category?: string; allowedValues?: Array<{ value: any; label: string; }>; } /** * Context structure sent to the AI */ interface PromptContext { /** List of available fields formatted for the prompt */ fieldsText: string; /** List of available properties for the selected target type */ propertiesText: string; /** List of supported JSON Logic operators */ operatorsText: string; /** Selected target type */ targetType: string; /** Structured list of fields for richer prompt suggestions */ minifiedFields?: MinifiedField[]; } /** * Example pair for Few-Shot Learning */ interface AiExamplePair { userPrompt: string; expectedResponse: AiRuleResponse; } /** * Configuration for the AI Service */ interface AiIntegrationConfig { /** LLM provider (gemini/openai/xai/mock) */ provider?: string; /** Gemini API Key (optional if using proxy/env) */ apiKey?: string; /** Model version to use */ model: string; /** Temperature (creativity vs determinism) */ temperature: number; /** Max output tokens */ maxTokens: number; /** Request timeout in ms */ timeout: number; /** Number of retry attempts */ retryAttempts: number; /** Optional: Backend gateway URL for Enterprise mode */ gatewayUrl?: string; } /** * Result of validating an AI response */ interface AiValidationResult { valid: boolean; errors: AiValidationError[]; warnings: AiValidationWarning[]; correctedResponse?: AiRuleResponse; } interface AiValidationError { field: string; message: string; severity: 'critical' | 'error' | 'warning'; code: string; } interface AiValidationWarning { field: string; message: string; suggestion?: string; } interface AiModel { name: string; version: string; displayName: string; description: string; inputTokenLimit: number; outputTokenLimit: number; supportedGenerationMethods: string[]; temperature?: number; topP?: number; topK?: number; } type ValueKind = 'boolean' | 'string' | 'number' | 'enum' | 'expression' | 'object' | 'array'; interface Capability { path: string; category: string; valueKind: ValueKind | string; allowedValues?: Array; description?: string; critical?: boolean; intentExamples?: string[]; dependsOn?: string; example?: string; safetyNotes?: string; } type RulePropertyType = 'string' | 'boolean' | 'object' | 'array' | 'enum' | 'number'; interface RulePropertyDefinition { name: string; type: RulePropertyType; label: string; description?: string; enumValues?: Array<{ value: string; label: string; }>; category?: 'content' | 'appearance' | 'behavior' | 'layout' | 'validation'; } type RulePropertySchema = Record<'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', RulePropertyDefinition[]>; type PraxisAssistantOwnerType = 'page-builder' | 'table' | 'dynamic-form' | 'manual-form' | 'list' | 'tabs' | 'stepper' | 'expansion' | 'app-shell' | 'custom'; type PraxisAssistantComponentType = 'page-builder' | 'table' | 'form' | 'list' | 'tabs' | 'stepper' | 'expansion' | 'widget' | 'custom'; type PraxisAssistantContextMode = 'config' | 'agentic-authoring' | 'chat' | 'diagnostic' | 'review' | 'inline-help'; type PraxisAssistantTargetKind = 'component' | 'field' | 'column' | 'row' | 'section' | 'widget' | 'canvas' | 'compositionLink' | 'action' | 'rule' | 'resource' | 'custom'; type PraxisAssistantAttachmentKind = 'file' | 'image' | 'json' | 'schema' | 'text' | 'url' | 'custom'; type PraxisAssistantActionKind = 'local-preview' | 'local-apply' | 'local-undo' | 'manifest-validate' | 'manifest-compile' | 'shared-rule-intake' | 'shared-rule-handoff' | 'governed-simulation-handoff' | 'governed-publication-handoff' | 'materialization-handoff' | 'enforcement-validation-handoff' | 'diagnose' | 'explain' | 'custom'; type PraxisAssistantRiskLevel = 'low' | 'medium' | 'high' | 'blocked'; interface PraxisAssistantIdentity { sessionId: string; ownerId: string; ownerType: PraxisAssistantOwnerType | string; componentId?: string; componentType?: PraxisAssistantComponentType | string; routeKey?: string; tenantId?: string; env?: string; userId?: string; } interface PraxisAssistantTargetRef { kind: PraxisAssistantTargetKind | string; id: string; label?: string; path?: string; schemaPath?: string; metadata?: Readonly>; } interface PraxisAssistantContextItem { id: string; label: string; value: string; kind?: string; tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger'; } interface PraxisAssistantDigest { label?: string; summary?: string; hash?: string; source?: string; fields?: readonly string[]; counts?: Readonly>; } interface PraxisAssistantAuthoringManifestRef { componentId: string; version?: string; source?: string; hash?: string; } interface PraxisAssistantCapabilityRef { id: string; label?: string; source?: string; risk?: PraxisAssistantRiskLevel; } interface PraxisAssistantGovernanceHint { kind: string; label?: string; reason?: string; target?: string; risk?: PraxisAssistantRiskLevel; } interface PraxisAssistantAttachmentSummary { id: string; name: string; kind: PraxisAssistantAttachmentKind | string; mimeType?: string; sizeBytes?: number; source?: string; hasPreview?: boolean; } interface PraxisAssistantActionContract { id: string; kind: PraxisAssistantActionKind | string; label?: string; target?: PraxisAssistantTargetRef; capabilityRef?: string; risk?: PraxisAssistantRiskLevel; handoffEndpoint?: string; description?: string; } interface PraxisAssistantContextSnapshot { identity: PraxisAssistantIdentity; target?: PraxisAssistantTargetRef; contextItems: readonly PraxisAssistantContextItem[]; mode: PraxisAssistantContextMode; authoringManifestRef?: PraxisAssistantAuthoringManifestRef; resourcePath?: string; schemaFields?: readonly string[]; dataProfileDigest?: PraxisAssistantDigest; runtimeStateDigest?: PraxisAssistantDigest; capabilityRefs?: readonly PraxisAssistantCapabilityRef[]; governanceHints?: readonly PraxisAssistantGovernanceHint[]; riskHints?: readonly PraxisAssistantGovernanceHint[]; attachmentSummaries?: readonly PraxisAssistantAttachmentSummary[]; actions?: readonly PraxisAssistantActionContract[]; } interface PraxisAssistantOpenRequest { initialPrompt?: string; target?: PraxisAssistantTargetRef; mode?: PraxisAssistantContextMode; visibility?: 'active' | 'minimized'; contextHints?: Readonly>; preferredAction?: PraxisAssistantActionContract; selection?: PraxisAssistantTargetRef; } declare const PRAXIS_ASSISTANT_CONTEXT_TEXT_LIMIT = 160; declare const PRAXIS_ASSISTANT_CONTEXT_ITEM_LIMIT = 12; declare const PRAXIS_ASSISTANT_CONTEXT_SCHEMA_FIELD_LIMIT = 40; declare const PRAXIS_ASSISTANT_CONTEXT_ATTACHMENT_LIMIT = 8; declare function sanitizePraxisAssistantText(value: unknown, limit?: number): string; declare function normalizePraxisAssistantAttachmentSummary(attachment: unknown): PraxisAssistantAttachmentSummary | null; declare function normalizePraxisAssistantContextSnapshot(value: unknown): PraxisAssistantContextSnapshot; type PraxisAssistantShellMessageRole = 'user' | 'assistant' | 'system' | 'status' | 'error'; type PraxisAssistantShellMode = 'config' | 'agentic-authoring' | 'chat' | 'diagnostic' | 'review' | 'inline-help'; type PraxisAssistantShellState = 'idle' | 'listening' | 'processing' | 'clarification' | 'review' | 'applying' | 'success' | 'error'; type PraxisAssistantVoiceInputMode = 'disabled' | 'browser-speech' | 'governed-transcription'; type PraxisAssistantVoiceCaptureState = 'unsupported' | 'idle' | 'listening' | 'stopping' | 'error'; interface PraxisAssistantShellMessage { id: string; role: PraxisAssistantShellMessageRole; text: string; assistantContent?: Readonly> | null; status?: 'pending' | 'done' | 'error'; editable?: boolean; resendable?: boolean; observationId?: string | null; actions?: readonly PraxisAssistantShellMessageAction[]; } interface PraxisAssistantShellQuickReply { id: string; label: string; prompt: string; value?: unknown; kind?: string; description?: string | null; icon?: string | null; tone?: string | null; presentation?: PraxisAssistantShellQuickReplyPresentation | null; contextHints?: Readonly> | null; canonicalAction?: Readonly> | null; semanticDecision?: Readonly> | null; } type PraxisAssistantShellQuickReplyPresentationKind = 'resource-candidate' | 'contextual-action' | 'governance-confirmation' | 'guided-option' | string; interface PraxisAssistantShellQuickReplyPresentation { kind?: PraxisAssistantShellQuickReplyPresentationKind | null; categoryLabel?: string | null; description?: string | null; ctaLabel?: string | null; icon?: string | null; tone?: string | null; technicalDetails?: string | null; evidence?: readonly PraxisAssistantShellQuickReplyEvidence[]; items?: readonly PraxisAssistantShellQuickReplyPresentationItem[]; } interface PraxisAssistantShellQuickReplyEvidence { icon?: string | null; value: string; ariaLabel?: string | null; } interface PraxisAssistantShellQuickReplyPresentationItem { key?: 'bestFor' | 'returns' | 'nextStep' | string; label: string; value: string; icon?: string | null; } type PraxisAssistantOpportunityCandidateStatus = 'available' | 'missing-context' | 'already-enabled' | 'blocked' | 'not-recommended' | string; type PraxisAssistantRecommendedIntentTone = 'neutral' | 'analytics' | 'resource' | 'success' | 'warning' | 'danger' | string; interface PraxisAssistantOpportunityGroup { id: string; label: string; description?: string | null; rank?: number | null; } interface PraxisAssistantRecommendedIntentPresentation { kind?: 'guided-card' | 'compact-chip' | 'spotlight' | string; description?: string | null; ctaLabel?: string | null; icon?: string | null; tone?: PraxisAssistantRecommendedIntentTone | null; evidence?: readonly PraxisAssistantShellQuickReplyEvidence[]; items?: readonly PraxisAssistantShellQuickReplyPresentationItem[]; } type PraxisAssistantRecommendedIntentAction = { kind: 'submit-prompt'; prompt: string; contextHints?: Readonly> | null; } | { kind: 'start-review'; operationKind: 'author' | 'execute' | string; componentEditPlan?: Readonly> | null; runtimeOperation?: Readonly> | null; contextHints?: Readonly> | null; } | { kind: 'open-guidance'; topicId: string; contextHints?: Readonly> | null; } | { kind: string; [key: string]: unknown; }; interface PraxisAssistantRecommendedIntent { kind?: 'praxis.assistant.recommended-intent' | string; id: string; label: string; description?: string | null; group?: PraxisAssistantOpportunityGroup | null; icon?: string | null; tone?: PraxisAssistantRecommendedIntentTone | null; presentation?: PraxisAssistantRecommendedIntentPresentation | null; action: PraxisAssistantRecommendedIntentAction; prompt?: string | null; contextHints?: Readonly> | null; sourceCandidateIds?: readonly string[]; rank?: number | null; confidence?: number | null; requiresConfirmation?: boolean; disabledReason?: string | null; } interface PraxisAssistantOpportunityEvidence { kind: 'component-state' | 'metadata' | 'selection' | 'capability' | 'usage' | 'host' | string; label?: string | null; value?: string | number | boolean | null; details?: Readonly> | null; } interface PraxisAssistantOpportunityTarget { kind: 'component' | 'field' | 'record-surface' | 'action' | 'navigation' | 'export' | string; id: string; label?: string | null; componentId?: string | null; field?: string | null; surfaceId?: string | null; capabilityId?: string | null; metadata?: Readonly> | null; } interface PraxisAssistantOpportunityMissingContext { id: string; label: string; reason?: string | null; required?: boolean; } interface PraxisAssistantOpportunitySafety { requiresConfirmation?: boolean; destructive?: boolean; reason?: string | null; } interface PraxisAssistantOpportunityCandidate { id: string; label: string; description?: string | null; group?: PraxisAssistantOpportunityGroup | null; target: PraxisAssistantOpportunityTarget; status?: PraxisAssistantOpportunityCandidateStatus; rank?: number | null; confidence?: number | null; evidence?: readonly PraxisAssistantOpportunityEvidence[]; missingContext?: readonly PraxisAssistantOpportunityMissingContext[]; safety?: PraxisAssistantOpportunitySafety | null; recommendedIntent?: PraxisAssistantRecommendedIntent | null; metadata?: Readonly> | null; } interface PraxisAssistantOpportunityCatalog { componentId: string; componentKind?: string | null; generatedAt?: string | null; stateHash?: string | null; candidates: readonly PraxisAssistantOpportunityCandidate[]; groups?: readonly PraxisAssistantOpportunityGroup[]; metadata?: Readonly> | null; } interface PraxisAssistantShellMessageAction { id: string; label: string; kind?: 'edit' | 'resend' | 'copy' | 'custom' | string; icon?: string | null; ariaLabel?: string | null; iconOnly?: boolean; disabled?: boolean; } type PraxisAssistantShellActionTone = 'primary' | 'secondary' | 'governance' | 'success' | 'warning' | 'danger' | 'neutral' | string; interface PraxisAssistantShellAction { id: string; label: string; kind?: 'submit-prompt' | 'apply' | 'retry' | 'cancel' | 'simulate' | 'review' | 'publish' | 'materialize' | 'correct' | 'custom' | string; icon?: string | null; tone?: PraxisAssistantShellActionTone | null; disabled?: boolean; requiresPrompt?: boolean; testId?: string | null; ariaLabel?: string | null; iconOnly?: boolean; } interface PraxisAssistantShellContextItem { id: string; label: string; value?: string; kind?: 'component' | 'schema' | 'selection' | 'route' | 'tenant' | 'mode' | 'custom' | string; icon?: string; } interface PraxisAssistantShellAttachment { id: string; name: string; kind: 'image' | 'file' | 'json' | 'schema' | 'text' | string; mimeType?: string; sizeBytes?: number; file?: File; previewUrl?: string; source?: 'paste' | 'file-picker' | 'host' | string; status?: 'ready' | 'uploading' | 'error'; error?: string; } interface PraxisAssistantShellLayout { left: number; top: number; width: number; height: number; } interface PraxisAssistantViewportLayoutOptions { width?: number; height?: number; top?: number; margin?: number; } declare function createPraxisAssistantViewportLayout(options?: PraxisAssistantViewportLayoutOptions): PraxisAssistantShellLayout; interface PraxisAssistantShellLabels { title: string; subtitle?: string; close: string; prompt: string; promptPlaceholder: string; emptyConversation: string; submit: string; apply: string; conversationAria: string; quickRepliesAria: string; quickReplyDetails?: string; recommendedIntentsAria: string; recommendedIntentsTitle: string; recommendedIntentCta: string; recommendedIntentGuidanceCta: string; recommendedIntentRequiresConfirmation: string; dragHandleAria: string; resizeHandleAria: string; resetLayout?: string; contextAria: string; attachmentsAria: string; attach: string; removeAttachment: string; editMessage: string; resendMessage: string; feedbackPositive: string; feedbackNegative: string; feedbackSubmitted: string; voiceStart?: string; voiceStop?: string; voiceListening?: string; voiceUnsupported?: string; voiceFailed?: string; voicePermissionDenied?: string; voiceNoSpeech?: string; modeConfig: string; modeAgenticAuthoring: string; modeChat: string; modeDiagnostic: string; modeReview: string; modeInlineHelp: string; stateIdle: string; stateListening: string; stateProcessing: string; stateClarification: string; stateReview: string; stateApplying: string; stateSuccess: string; stateError: string; } type PraxisAssistantTurnPhase = 'capture' | 'contextualize' | 'clarify' | 'plan' | 'preview' | 'review' | 'apply' | 'summarize'; type PraxisAssistantClarificationQuestionType = 'text' | 'single-choice' | 'multi-choice' | 'confirm' | 'resource' | 'field' | 'schema' | 'date-range' | 'number' | 'color' | 'component'; interface PraxisAssistantClarificationOption { id: string; label: string; value: string; rawValue?: unknown; description?: string; displayPrompt?: string; example?: string; contextHints?: Record; canonicalAction?: Record; semanticDecision?: Record; } interface PraxisAssistantClarificationQuestion { id: string; type: PraxisAssistantClarificationQuestionType; label: string; description?: string; required?: boolean; allowCustom?: boolean; options?: readonly PraxisAssistantClarificationOption[]; } interface PraxisAssistantTurnAction { kind: 'submit' | 'clarify' | 'apply' | 'cancel' | 'retry' | 'edit-message' | 'resend-message' | 'attach' | 'remove-attachment' | string; id?: string; value?: unknown; displayPrompt?: string; contextHints?: Record; activeSemanticDecision?: Record; } interface PraxisAssistantPendingClarification { sourcePrompt: string; questions: readonly PraxisAssistantClarificationQuestion[]; assistantMessage?: string; clientTurnId?: string; diagnostics?: Record; observationId?: string | null; } type PraxisAssistantConversationMessageRole = 'user' | 'assistant' | 'system'; interface PraxisAssistantConversationMessage { id: string; role: PraxisAssistantConversationMessageRole; text: string; } declare function toPraxisAssistantConversationMessages(messages: readonly PraxisAssistantShellMessage[], limit?: number): PraxisAssistantConversationMessage[]; interface PraxisAssistantTurnRequest { mode: PraxisAssistantShellMode; phase?: PraxisAssistantTurnPhase; prompt?: string; action?: PraxisAssistantTurnAction; sessionId?: string; clientTurnId?: string; componentId?: string; componentType?: string; messages?: readonly PraxisAssistantShellMessage[]; contextItems?: readonly PraxisAssistantShellContextItem[]; attachments?: readonly PraxisAssistantShellAttachment[]; currentState?: unknown; runtimeState?: unknown; schemaFields?: unknown; dataProfile?: unknown; contextHints?: Record; activeSemanticDecision?: Record; preview?: unknown; pendingPatch?: unknown; pendingClarification?: PraxisAssistantPendingClarification; diagnostics?: Record; observationId?: string | null; runtimeComponentObservations?: readonly PraxisRuntimeComponentObservationEnvelope[]; } interface PraxisAssistantTurnResult { state: PraxisAssistantShellState; phase?: PraxisAssistantTurnPhase; assistantMessage?: string; assistantContent?: Readonly> | null; messages?: readonly PraxisAssistantShellMessage[]; quickReplies?: readonly PraxisAssistantShellQuickReply[]; clarificationQuestions?: readonly PraxisAssistantClarificationQuestion[]; contextItems?: readonly PraxisAssistantShellContextItem[]; attachments?: readonly PraxisAssistantShellAttachment[]; canApply?: boolean; statusText?: string; errorText?: string; preview?: unknown; pendingPatch?: unknown; pendingClarification?: PraxisAssistantPendingClarification | null; sessionId?: string; clientTurnId?: string; diagnostics?: Record; observationId?: string | null; } interface PraxisAssistantTurnViewState { mode: PraxisAssistantShellMode; state: PraxisAssistantShellState; phase: PraxisAssistantTurnPhase; sessionId?: string; clientTurnId?: string; messages: PraxisAssistantShellMessage[]; quickReplies: PraxisAssistantShellQuickReply[]; clarificationQuestions: PraxisAssistantClarificationQuestion[]; contextItems: PraxisAssistantShellContextItem[]; attachments: PraxisAssistantShellAttachment[]; canApply: boolean; statusText: string; errorText: string; preview?: unknown; pendingPatch?: unknown; pendingClarification?: PraxisAssistantPendingClarification; diagnostics?: Record; observationId?: string | null; } interface PraxisAssistantTurnFlow { readonly mode: PraxisAssistantShellMode; submit(request: PraxisAssistantTurnRequest): Promise | rxjs.Observable; apply?(request: PraxisAssistantTurnRequest): Promise | rxjs.Observable; cancel?(request: PraxisAssistantTurnRequest): Promise | rxjs.Observable; retry?(request: PraxisAssistantTurnRequest): Promise | rxjs.Observable; } interface PatchResult { success: boolean; warnings?: string[]; error?: string; } interface AiSuggestion { id: string; label: string; description?: string; icon?: string; group?: string; intent: string; score?: number; variantId?: string; patch?: Record | null; contextHints?: Record | null; missingContext?: string[]; } interface AiResponseCompileResult { patch?: AiJsonObject; explanation?: string; type?: 'error'; message?: string; warnings?: string[]; } type AiAuthoringResponseModeKind = 'consult' | 'edit' | string; interface AiAuthoringResponseMode { kind: AiAuthoringResponseModeKind; operationKind?: 'consult' | 'author' | 'edit' | string; changeKind?: 'answer' | string; preferredResponse?: string; useWhen?: string[]; rules?: string[]; } interface AiConsultativeAuthoringContext { [key: string]: unknown; resourcePath?: string | null; answerableQuestionKinds?: string[]; } interface AiComponentAuthoringContract { [key: string]: unknown; kind: 'praxis.component-authoring-context' | string; componentId?: string; componentType?: string; preferredResponse?: string; responseModes?: AiAuthoringResponseMode[]; consultativeContext?: AiConsultativeAuthoringContext; } declare function createComponentAuthoringContext(authoringContract: AiComponentAuthoringContract): AiJsonObject; declare function toAiJsonObject(value: unknown, path?: string): AiJsonObject; /** * Contrato fundamental para qualquer componente que suporte configuração via IA. * O Agente de IA usa esta interface para Ler (Introspecção) e Escrever (Patching) no componente. */ interface AiConfigAdapter { /** * Nome legível do componente para o contexto do prompt (ex: "Data Table"). */ componentName: string; /** * ID do componente (selector) usado pelo backend AI registry (ex: "praxis-table"). */ componentId?: string; /** * Tipo lógico do componente para contexto (ex: "table", "form"). */ componentType?: string; /** * Retorna o objeto de configuração serializável atual. * Usado para que a IA entenda o estado inicial. */ getCurrentConfig(): TConfig; /** * Retorna o catálogo de capacidades (o que a IA pode mudar). * Deve ser o conteúdo do arquivo `_ai-capabilities.ts`. */ getCapabilities(): Capability[]; /** * Retorna exemplos de intenção ou presets de tarefas suportados. * Útil para filtrar capabilities no prompt. * @deprecated Use getSuggestions() for richer context. */ getTaskPresets?(): Record; /** * Retorna sugestões contextuais baseadas na config atual e dados (Heurísticas). * Substitui ou complementa os presets estáticos. */ getSuggestions?(forceReload?: boolean): Promise; /** * Retorna contexto adicional para geração de sugestões (ex.: recursos disponíveis). */ getSuggestionContext?(): Record; /** * Retorna o perfil de dados atual (ex.: estatísticas por coluna). * Usado para sugestões determinísticas no backend. */ getDataProfile?(): Record; /** * Retorna hints de schema por campo (ex.: controlType, numericFormat). * Usado para sugestões heurísticas mais precisas no backend. */ getSchemaFields?(): Record[]; /** * Prepara contexto assíncrono necessário antes de montar snapshots para IA. * Ex.: uma tabela pode carregar o schema canônico de filtros antes de expor * o contrato de authoring ao backend. */ prepareAuthoringContext?(): Promise | void; /** * Retorna contexto declarativo adicional para authoring assistido por IA. * Deve conter contratos validaveis e instrucoes especificas do componente * que o backend pode incluir em contextHints sem conhecer a lib concreta. */ getAuthoringContext?(): AiJsonObject | null | undefined; /** * Retorna um snapshot do estado de tempo de execução (volátil). * Ex: { rowCount: 50, isLoading: false, sort: 'name:asc' }. * Usado para responder perguntas do usuário ("Por que está vazio?"). */ getRuntimeState?(): Record; /** * Compila respostas declarativas especificas do componente em patch canonico. * Ex.: uma tabela pode transformar "componentEditPlan" em alteracoes validadas de colunas. * Retorne null/undefined quando a resposta ja estiver no contrato comum do assistente. */ compileAiResponse?(response: Record): AiResponseCompileResult | null | undefined; /** * Cria um snapshot do estado atual para fins de Undo. * Retorna um token opaco (pode ser o config JSON completo ou um ID). */ createSnapshot(): any; /** * Restaura o estado para um snapshot anterior. */ restoreSnapshot(snapshot: any): Promise; /** * Aplica um patch de configuração gerado pela IA. * O Adapter deve validar, mesclar e garantir a reatividade do componente. * * @param patch O JSON parcial gerado pela IA. * @param intent A intenção original do usuário (para logs ou decisões heurísticas). */ applyPatch(patch: Partial, intent?: string): Promise; } /** * Base implementation for AI Adapters. * Provides common validation logic against the Capabilities Catalog. */ declare abstract class BaseAiAdapter implements AiConfigAdapter { abstract componentName: string; abstract getCurrentConfig(): TConfig; abstract getCapabilities(): Capability[]; abstract applyPatch(patch: Partial, intent?: string): Promise; abstract createSnapshot(): any; abstract restoreSnapshot(snapshot: any): Promise; getTaskPresets?(): Record; getSuggestions(_forceReload?: boolean): Promise; getSuggestionContext?(): Record; getRuntimeState?(): Record; getAuthoringContext?(): Record | null; compileAiResponse?(_response: Record): AiResponseCompileResult | null; /** * Helper to validate a patch against the capabilities catalog. * Removes keys that are not in the allowed paths. */ protected validatePatchAgainstCapabilities(patch: any): any; /** * Helper to check if a patch contains critical changes. */ protected getCriticalWarnings(patch: any): string[]; } type PraxisAuthoringScopeChatMessage = { role: 'user' | 'assistant' | 'system'; content: string; }; interface PraxisAuthoringScopePolicyOptions { componentId?: string | null; componentType?: string | null; componentLabel?: string | null; } interface PraxisAuthoringScopePolicyRequest { messages?: PraxisAuthoringScopeChatMessage[] | null; contextHints?: AiJsonObject | null; } declare const PRAXIS_AUTHORING_SCOPE_POLICY_KIND = "praxis.authoring-scope-policy.v1"; declare const PRAXIS_AUTHORING_SCOPE_POLICY_VERSION = "1.0"; declare function createAuthoringScopePolicyContext(options?: PraxisAuthoringScopePolicyOptions): AiJsonObject; declare function createAuthoringScopePolicySystemMessage(options?: PraxisAuthoringScopePolicyOptions): PraxisAuthoringScopeChatMessage; declare function withAuthoringScopePolicy(request: TRequest, options?: PraxisAuthoringScopePolicyOptions): TRequest; declare function withAuthoringScopePolicyMessage(messages: readonly PraxisAuthoringScopeChatMessage[] | null | undefined, options?: PraxisAuthoringScopePolicyOptions): PraxisAuthoringScopeChatMessage[]; declare function withAuthoringScopePolicyContextHints(contextHints: AiJsonObject | null | undefined, options?: PraxisAuthoringScopePolicyOptions): AiJsonObject; interface AiGovernedDecisionRoutingOptions { localCompositionTerms?: readonly string[]; } /** * @deprecated Component assistants must not infer governed authoring from user * wording. Route through the backend semantic resolver and use this only for * explicit, structured context provided by a canonical backend source. */ declare function shouldRoutePromptToGovernedDecision(prompt: string, contextHints?: AiJsonObject, options?: AiGovernedDecisionRoutingOptions): boolean; declare function normalizeAuthoringPrompt(prompt: string): string; interface FieldSchemaLike { label: string; type: string; description?: string; required?: boolean; uiConfig?: { category?: string; }; allowedValues?: Array<{ value: any; label: string; }>; } declare class SchemaMinifierService { /** * Converts complete FieldSchemas into a minified version for AI context (Token optimized) */ minify(schemas: Record): MinifiedField[]; /** * Formats minified fields into a string for the AI prompt (Legacy/Text mode) */ toPromptFormat(fields: MinifiedField[]): string; /** * Transforms Praxis FieldSchemas into Google Gemini JSON Schema format. * This enables "Response Schema" enforcement in the API. */ toGeminiSchema(fields: Record): Schema; private mapTypeToGemini; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface PraxisAiConfigSource { getAiConfigSnapshot?: () => Partial | null | undefined; aiConfigChanges$?: Observable | null>; } declare class PraxisAiService { private readonly configSource; private genAI; private config; constructor(configSource: PraxisAiConfigSource | null); private syncConfig; classifyIntent(userInput: string, columns: string[]): Observable; answerQuestion(userInput: string, targetConfig: any): Observable; executeEnrichedPrompt(userInput: string, contextDescription: string, targetConfig: any, capabilities: any): Observable; private formatCapabilities; generateContent(prompt: string, modelName?: string): Observable; generateContentStream(prompt: string, modelName?: string): Observable; generateJson(prompt: string, modelName?: string, schema?: any): Observable; isMockMode(): boolean; listModels(apiKey?: string): Observable; testConnection(apiKey?: string, model?: string): Observable; private resolveProvider; private isGeminiProvider; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const AI_INTENT_CONTRACT_VERSION: "v1.1"; declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "d817fcf351207371c5cb8528b70c0ba6830648710581b08c7cc2b2b428989289"; type AiSchemaContext = AiSchemaContextContract; interface AiSuggestionsRequest { componentId: string; componentType: string; currentState: AiJsonObject; dataProfile?: AiJsonObject | null; variantId?: string; maxSuggestions?: number; forceRefresh?: boolean; locale?: string; } interface AiSuggestionsResponse { suggestions: AiSuggestion[]; source?: string; cacheKey?: string; cacheHit?: boolean; warnings?: string[]; } type AiOrchestratorRequest = AiOrchestratorRequestContract; type AiChatMessage = AiChatMessageContract; type AiUiContextRef = AiUiContextRefContract; type AiCurrentStateDigest = AiCurrentStateDigestContract; type AiPatchDiff = AiPatchDiffContract; type AiOrchestratorResponse = AiOrchestratorResponseContract & { riskLevel?: string; requiresConfirmation?: boolean; questions?: string[]; }; type AiPatchStreamEventType = AiPatchStreamEventType$1; type AiPatchStreamStartResponse = AiPatchStreamStartResponseContract; type AiPatchStreamCancelResponse = AiPatchStreamCancelResponseContract; type AiPatchStreamEnvelope = AiPatchStreamEnvelopeContract; type AgenticAuthoringManifestEditPlanRequest = AgenticAuthoringManifestEditPlanRequestContract; type AgenticAuthoringResolveTargetRequest = AgenticAuthoringResolveTargetRequestContract; type AgenticAuthoringResolvedTarget = AgenticAuthoringResolvedTargetContract; type AgenticAuthoringManifestValidationResult = AgenticAuthoringManifestValidationResultContract; type AgenticAuthoringManifestCompileResult = AgenticAuthoringManifestCompileResultContract; type WithoutStringIndex = { [K in keyof T as string extends K ? never : K]: T[K]; }; type AgenticAuthoringTurnStreamRequest = WithoutStringIndex & Record & { runtimeComponentObservations?: readonly PraxisRuntimeComponentObservationEnvelope[] | readonly unknown[] | null; runtimeComponentObservationTrustBoundary?: 'untrusted_frontend_observation' | null; }; type AgenticAuthoringTurnStreamStartResponse = AgenticAuthoringTurnStreamStartResponseContract; type AgenticAuthoringTurnStreamEnvelope = AgenticAuthoringTurnStreamEnvelopeContract; interface AiPatchStreamConnection { events$: Observable; close: () => void; } interface AgenticAuthoringTurnStreamConnection { events$: Observable; close: () => void; } interface AgenticAuthoringTurnStreamLifecycle { phase: string; transport?: 'event-source' | 'fetch' | string; connectElapsedMs?: number; probeStatus?: number | null; firstEventSeq?: number | null; firstEventType?: string | null; } interface AgenticAuthoringTurnStreamConnectionOptions { baseUrl?: string; headers?: Record; onLifecycle?: (event: AgenticAuthoringTurnStreamLifecycle) => void; } interface AgenticAuthoringTurnStreamStartOptions { baseUrl?: string; headers?: Record; } type AiPatchStreamConnectionErrorKind = 'unsupported' | 'http_status' | 'transport' | 'parse' | 'schema'; declare class AiPatchStreamConnectionError extends Error { readonly kind: AiPatchStreamConnectionErrorKind; readonly status?: number | undefined; constructor(kind: AiPatchStreamConnectionErrorKind, message: string, status?: number | undefined); } interface AiProviderModelsRequest { provider?: string; apiKey?: string; } interface AiProviderModelsResponse { provider?: string; success?: boolean; message?: string; models?: AiModel[]; } interface AiProviderCatalogItem { id: string; label: string; description?: string; defaultModel?: string; requiresApiKey?: boolean; supportsModels?: boolean; supportsEmbeddings?: boolean; supportsTextStreaming?: boolean; supportsTurnCancellation?: boolean; iconKey?: string; } interface AiProviderCatalogResponse { providers: AiProviderCatalogItem[]; } interface AiProviderTestRequest { provider?: string; apiKey?: string; model?: string; } interface AiProviderTestResponse { provider?: string; model?: string; success?: boolean; message?: string; } interface AiProviderStatusResponse { provider?: string; model?: string; hasApiKey?: boolean; source?: string; success?: boolean; message?: string; } interface AiAudioTranscriptionResponse { schemaVersion: 'praxis-ai-audio-transcription.v1' | string; text: string; provider?: string | null; model?: string | null; language?: string | null; } type AiAssistantObservationFeedbackRatingValue = AiAssistantObservationFeedbackRating; type AiAssistantObservationFeedbackRequest = AiAssistantObservationFeedbackRequestContract; type AiAssistantObservationFeedbackResponse = AiAssistantObservationFeedbackResponseContract; interface AiContextTemplateMeta { variants?: Array<{ id?: string; registryKey?: string; } | string>; defaultVariantId?: string; } interface AiContextTemplate { templateMeta?: AiContextTemplateMeta; } interface AiContextDTO { componentId?: string; componentType?: string; template?: AiContextTemplate | null; } interface AiHeaderContext { tenantId: string; env: string; userId: string; missing: string[]; } interface AiGlobalConfigSnapshot { provider?: string; apiKey?: string; model?: string; temperature?: number; maxTokens?: number; timeout?: number; retryAttempts?: number; gatewayUrl?: string; riskPolicy?: string; } interface AiBackendConfigStore { getAiConfigSnapshot?: () => AiGlobalConfigSnapshot | null | undefined; aiConfigChanges$?: Observable; saveAiConfig?: (config: AiGlobalConfigSnapshot) => Promise; } interface AiBackendStorageOptions { headersFactory?: () => Record; defaultHeaders?: Record; allowLocalIdentityFallback?: boolean; } interface AiBackendEndpoints { /** * Explicit base URL for `/praxis/config/ai/**`. * Hosts should normally prefer the shared `API_URL.default.baseUrl`; use this * only when AI orchestration is served by a distinct gateway. */ aiBaseUrl?: string; /** * Explicit base URL for `/praxis/config/ai-context/**`. * When omitted, the service derives it from `API_URL.default.baseUrl`. */ aiContextBaseUrl?: string; } declare const AI_BACKEND_CONFIG_STORE: InjectionToken; declare const AI_BACKEND_STORAGE_OPTIONS: InjectionToken; declare const AI_BACKEND_ENDPOINTS: InjectionToken; declare class AiBackendApiService { private readonly http; private readonly globalConfigStore; private readonly storageOpts; private readonly endpointOpts; private readonly apiUrlConfig; private readonly fallbackAiBaseUrl; private readonly fallbackAiContextBaseUrl; getSuggestions(request: AiSuggestionsRequest): Observable; getPatch(request: AiOrchestratorRequest): Observable; startPatchStream(request: AiOrchestratorRequest): Observable; connectPatchStream(streamId: string, lastEventId?: string, accessToken?: string): AiPatchStreamConnection; cancelPatchStream(streamId: string, accessToken?: string): Observable; startAgenticAuthoringTurnStream(request: AgenticAuthoringTurnStreamRequest, options?: AgenticAuthoringTurnStreamStartOptions): Observable; connectAgenticAuthoringTurnStream(streamId: string, lastEventId?: string, accessToken?: string, options?: AgenticAuthoringTurnStreamConnectionOptions): AgenticAuthoringTurnStreamConnection; cancelAgenticAuthoringTurnStream(streamId: string, accessToken?: string, options?: AgenticAuthoringTurnStreamStartOptions): Observable; sendAssistantObservationFeedback(observationId: string, request: AiAssistantObservationFeedbackRequest): Observable; listModels(request: AiProviderModelsRequest): Observable; listProviderCatalog(): Observable; testProvider(request: AiProviderTestRequest): Observable; getAiStatus(): Observable; transcribeAudio(audio: Blob, fileName: string, language?: string | null): Observable; getAiContext(componentId: string, componentType: string): Observable; getAgenticAuthoringManifest(componentId: string): Observable; listAgenticAuthoringManifestTargets(componentId: string): Observable; listAgenticAuthoringManifestOperations(componentId: string): Observable; resolveAgenticAuthoringManifestTarget(componentId: string, request: AgenticAuthoringResolveTargetRequest): Observable; validateAgenticAuthoringManifestPlan(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable; compileAgenticAuthoringManifestPatch(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable; loadGlobalAiConfig(): Observable; saveGlobalAiConfig(aiConfig: AiGlobalConfigSnapshot): Observable; getHeaderContext(): AiHeaderContext; private buildHeaders; private normalizeContractVersion; private normalizeContractSchemaHash; private normalizeLegacyPatchConversationIds; private normalizeConversationUuid; private isUuid; private authoringManifestUrl; private aiBaseUrl; private aiContextBaseUrl; private resolveBaseUrl; private resolveApiBaseUrl; private joinUrl; private normalizeBaseUrl; private buildApiUrl; private resolveHeaderMap; private parsePatchStreamEnvelope; private isPatchStreamEnvelope; private isJsonObject; private registerNamedStreamEventListeners; private isTerminalStreamEventType; private agenticAuthoringBaseUrl; private consumeFetchAgenticTurnStream; private consumeBufferedSseFrames; private findSseFrameBoundary; private probePatchStreamEndpoint; private buildFetchHeaders; private hasExplicitHeaders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface PraxisBrowserSpeechTranscriptionOptions { lang?: string | null; } interface PraxisBrowserSpeechTranscriptionResult { text: string; language?: string | null; } declare class PraxisGovernedAudioTranscriptionService { private readonly backend; private activeRecorder; private activeStream; private cancelled; isSupported(): boolean; transcribe(options?: PraxisBrowserSpeechTranscriptionOptions): Promise; stop(): void; cancel(): void; private resolveMimeType; private cleanup; private stopTracks; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface AgenticAuthoringTurnClientOptions { readonly baseUrl?: string; readonly headers?: Record; readonly initialStatusText?: string; readonly silenceStatusMs?: number; readonly resultTimeoutMs?: number; readonly streamTimeoutMs?: number; } interface AgenticAuthoringTurnStreamStartedEvent { readonly kind: 'stream-started'; readonly start: AgenticAuthoringTurnStreamStartResponseContract; } interface AgenticAuthoringTurnStreamEnvelopeEvent { readonly kind: 'stream-event'; readonly event: AgenticAuthoringTurnStreamEnvelopeContract; } interface AgenticAuthoringTurnLifecycleEvent { readonly kind: 'stream-lifecycle'; readonly start: AgenticAuthoringTurnStreamStartResponseContract; readonly phase: string; readonly statusText: string; readonly diagnostics?: AiJsonObject; } type AgenticAuthoringTurnClientEvent = AgenticAuthoringTurnStreamStartedEvent | AgenticAuthoringTurnLifecycleEvent | AgenticAuthoringTurnStreamEnvelopeEvent; declare class AgenticAuthoringTurnClientService { private readonly aiApi; private readonly logger; private readonly runtimeObservationRegistry; streamEvents(request: AgenticAuthoringTurnStreamRequest, options?: AgenticAuthoringTurnClientOptions): Observable; streamTurn(request: AgenticAuthoringTurnStreamRequest, options?: AgenticAuthoringTurnClientOptions): Observable; toTurnResult(event: AgenticAuthoringTurnStreamEnvelopeContract, clientTurnId?: string | null): PraxisAssistantTurnResult; private withRuntimeObservationTrustBoundary; private collectRuntimeComponentObservations; private isRuntimeComponentObservationEnvelopeLike; private startAuthoringTurnStream; private isPromiseLike; private toResultTurn; private isConsultativeCatalogAnswer; private toShellQuickReplies; private toPendingClarification; private phaseForPayload; private statusForPayload; private resultDiagnostics; private runtimeRelatedSurfaceDisambiguationContext; private runtimeRelatedSurfaceDisambiguationPageId; private toLifecycleEvent; private silenceStatusEvent; private resultTimeoutEvent; private streamTimeoutEvent; private isTurnTimeoutError; private cancelTimedOutTurn; private logTimeoutCancellation; private turnTelemetryContext; private safeTelemetryDimension; private logTurnLifecycle; private isTerminalEventType; private terminalTelemetryOutcome; private toQuickReplies; private isQuickReply; private toPendingClarificationContract; private readString; private readDisplayString; private isRedactedDisplayText; private toJsonObject; private isRecord; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface ValidationContext { fieldSchemas: Record; targetSchemas?: any; propertySchema: RulePropertySchema; } declare class AiResponseValidatorService { /** * Validates the complete AI response */ validate(response: AiRuleResponse, context: ValidationContext): AiValidationResult; private validateStructure; private validateTargetIds; private validateCondition; private validateJsonLogicExpression; private walkJsonLogicNode; private isSupportedJsonLogicOperator; private validateJsonLogicOperatorArity; private collectVarPaths; private isValidTargetId; private findSimilarTargetId; private calculateSimilarity; private levenshteinDistance; private validatePropertyType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface PraxisAssistantTurnControllerOptions { componentId?: string; componentType?: string; sessionId?: string; contextItems?: readonly PraxisAssistantShellContextItem[]; attachments?: readonly PraxisAssistantShellAttachment[]; currentState?: unknown; runtimeState?: unknown; schemaFields?: unknown; dataProfile?: unknown; contextHints?: Record; } declare class PraxisAssistantTurnOrchestratorService { private readonly runtimeObservationRegistry; createController(flow: PraxisAssistantTurnFlow, options?: PraxisAssistantTurnControllerOptions): PraxisAssistantTurnController; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class PraxisAssistantTurnController { private readonly flow; private readonly options; private readonly runtimeObservationRegistry; private readonly stateSubject; readonly state$: Observable; private activeFlowClientTurnId; constructor(flow: PraxisAssistantTurnFlow, options: PraxisAssistantTurnControllerOptions, runtimeObservationRegistry: PraxisRuntimeComponentObservationRegistryService | null); snapshot(): PraxisAssistantTurnViewState; setContextHints(hints: Record | undefined): void; setContextItems(items: readonly PraxisAssistantShellContextItem[]): void; setMessages(messages: readonly PraxisAssistantShellMessage[]): void; setAttachments(attachments: readonly PraxisAssistantShellAttachment[]): void; addAttachment(attachment: PraxisAssistantShellAttachment): void; removeAttachment(id: string): void; editMessage(messageId: string, text: string): void; resendMessage(messageId: string): Observable; submitEditedMessage(messageId: string, text: string): Observable; submitPrompt(prompt: string, action?: PraxisAssistantTurnAction): Observable; answerClarification(option: PraxisAssistantClarificationOption | string): Observable; private semanticClarificationContextHints; apply(): Observable; retry(): Observable; cancel(): Observable; private runFlow; private invokeFlow; private buildRequest; private collectRuntimeComponentObservations; private isPromiseLike; private submitExistingUserMessage; private findUserMessageIndex; private resetReplayState; private resetActiveTurnState; private shouldApplyFlowResult; private resetConversationState; private resetConversationAfterCancel; private applyResult; private resolveCanonicalSessionId; private resolveSubmitAction; private buildPendingClarification; private resolvePendingClarificationSourcePrompt; private resolveMessageRole; private resolvePhase; private buildMessage; private shouldAttachObservationId; private createId; private patchState; private cloneState; private toObservable; private buildFlowErrorResult; private describeFlowError; private serializeFlowError; private toRecord; private toString; private toNumber; } declare function toPraxisAssistantClarificationOption(reply: PraxisAssistantShellQuickReply): PraxisAssistantClarificationOption; declare function submitPraxisAssistantQuickReply(controller: PraxisAssistantTurnController, reply: PraxisAssistantShellQuickReply): Observable; type PraxisAssistantSessionVisibility = 'active' | 'minimized'; type PraxisAssistantSessionPresence = 'global-dock' | 'origin-anchor'; interface PraxisAssistantSessionDescriptor { id: string; ownerId: string; ownerType: string; title: string; summary?: string | null; mode?: PraxisAssistantShellMode | null; state?: PraxisAssistantShellState | null; visibility?: PraxisAssistantSessionVisibility | null; contextItems?: readonly PraxisAssistantShellContextItem[] | null; contextSnapshot?: PraxisAssistantContextSnapshot | null; badge?: string | null; icon?: string | null; presence?: PraxisAssistantSessionPresence | null; updatedAt?: string | null; } interface PraxisAssistantSessionSnapshot { id: string; ownerId: string; ownerType: string; title: string; summary: string; mode: PraxisAssistantShellMode; state: PraxisAssistantShellState; visibility: PraxisAssistantSessionVisibility; contextItems: readonly PraxisAssistantShellContextItem[]; contextSnapshot: PraxisAssistantContextSnapshot | null; badge: string; icon: string; presence: PraxisAssistantSessionPresence; createdAt: string; updatedAt: string; } type PraxisAssistantSessionIdentityRef = string | PraxisAssistantIdentity | PraxisAssistantContextSnapshot; type PraxisAssistantContextSessionDescriptor = Omit & { title?: string; }; declare class PraxisAssistantSessionRegistryService { private readonly sessionsState; readonly sessions: i0.Signal; readonly activeSession: i0.Signal; readonly minimizedSessions: i0.Signal; upsertSession(descriptor: PraxisAssistantSessionDescriptor): PraxisAssistantSessionSnapshot; upsertContextSession(contextSnapshot: PraxisAssistantContextSnapshot, descriptor?: PraxisAssistantContextSessionDescriptor): PraxisAssistantSessionSnapshot; openSession(sessionId: string): PraxisAssistantSessionSnapshot | null; openContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null; minimizeSession(sessionId: string): PraxisAssistantSessionSnapshot | null; minimizeContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null; removeSession(sessionId: string): void; removeContextSession(identity: PraxisAssistantSessionIdentityRef): void; getSession(sessionId: string): PraxisAssistantSessionSnapshot | null; getContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null; clear(): void; private setVisibility; private resolveSessionId; private normalizeDescriptor; private assertContextIdentity; private toShellContextItems; private sortSessions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type AssistantMessageRole = 'user' | 'assistant' | 'system'; interface AssistantHistoryMessage { id: string; role: AssistantMessageRole; text: string; createdAt: string; context?: { componentId?: string; componentType?: string; variantId?: string; suggestionId?: string; usedRag?: boolean; }; } interface AssistantHistorySession { id: string; title: string; tenantId: string; env: string; userId: string; componentId?: string; componentType?: string; serverSessionId?: string | null; createdAt: string; updatedAt: string; messages: AssistantHistoryMessage[]; summary?: string; } interface AssistantHistoryContext extends AiHeaderContext { storageAvailable: boolean; } type AssistantState = 'idle' | 'listening' | 'clarification' | 'processing' | 'review' | 'applying' | 'success' | 'error'; interface ClarificationOption { label: string; value: string; example?: string; } type ClarificationContextHints = AiContextHintsContract; interface ClarificationRichOption extends ClarificationOption { contextHints?: ClarificationContextHints; } interface PatchPathEdit { path: string; valueText: string; error?: string; } type RiskPolicy = 'strict' | 'standard'; type ReviewRiskLevel = 'baixo' | 'médio' | 'alto'; declare class PraxisAiAssistantComponent implements OnDestroy { adapter: AiConfigAdapter; riskPolicy: RiskPolicy | null; allowManualPatchEdit: boolean; hasBackdrop: boolean; readonly overlayPositions: ConnectedPosition[]; overlayOrigin: CdkOverlayOrigin; triggerButton?: ElementRef; inputElement: ElementRef; state: AssistantState | 'clarification'; activeTab: 'task' | 'chat' | 'suggestions'; private readonly tabOrder; readonly flowSteps: readonly [{ readonly step: 1; readonly label: "Pedido"; }, { readonly step: 2; readonly label: "Proposta"; }, { readonly step: 3; readonly label: "Impacto"; }, { readonly step: 4; readonly label: "Aplicação"; }]; private taskFlowActive; processingInfoVisible: boolean; isOpen: boolean; loadingSuggestions: boolean; userPrompt: string; aiExplanation: string; pendingPatch: Record | null; pendingDiff: AiPatchDiff[]; patchEditorText: string; patchEditorError: string; patchEditorExpanded: boolean; patchPathEditorExpanded: boolean; patchPathEdits: PatchPathEdit[]; patchPathEditorError: string; applyWarnings: string[]; lastApplyAt: string | null; lastSnapshot: unknown; errorMsg: string; warnings: string[]; private backendRiskLevel; private backendRequiresConfirmation; private effectiveRiskPolicy; suggestionsWarnings: string[]; mockMode: boolean; clarificationMessage: string; clarificationOptions: ClarificationRichOption[]; clarificationQuestions: string[]; clarificationAnswers: string[]; clarificationFreeText: string; showManualInput: boolean; private clarificationBasePrompt; private skipClarificationAppend; clarificationResponseType: 'text' | 'choice' | 'confirm' | 'mixed' | 'context'; clarificationSelectionMode: 'single' | 'multiple'; clarificationAllowCustom: boolean; clarificationPresentation: 'buttons' | 'list' | 'chips'; selectedClarificationOptions: ClarificationRichOption[]; richSuggestions: AiSuggestion[]; private dismissedSuggestionIds; private readonly aiApi; private readonly historyService; private readonly dialog; private readonly cdr; private readonly suggestionsCache; private readonly templateVariantsCache; private activeVariantId; private promptFromSuggestion; private activeSuggestion; private activeContextHints; private activeResourcePath; private activeServerSessionId; private activeStreamId; private activeStreamAccessToken; private activeStreamConnection; private streamSeenEventIds; private streamLastSeqByStream; private streamLastEventIdByStream; private streamLastSeq; private streamLastEventId; private streamTerminalState; private streamTimelineMode; private streamFallbackActive; private streamTimelineStepState; private streamTimelineStepDetail; private currentComponentId; private currentComponentType; private forceNewSession; private readonly sessionStorageAvailable; historyContext: AssistantHistoryContext | null; historyWarnings: string[]; historySessions: Array<{ id: string; title: string; updatedAt: string; componentId?: string; componentType?: string; }>; activeHistorySession: AssistantHistorySession | null; activeHistoryMessages: AssistantHistoryMessage[]; activeHistoryTotalMessages: number; historyExpanded: boolean; historyUndoDeleteSession: AssistantHistorySession | null; private historyUndoTimerId; highlightClarificationDetails: boolean; highlightReviewDetails: boolean; private thoughtDetailsHighlightTimerId; showFullDiff: boolean; private processingStartedAt; private lastProcessingDurationMs; private readonly westernTwoDigitFormatter; private readonly maxHistoryMessages; ngOnDestroy(): void; open(): Promise; close(): void; submitPrompt(overridePrompt?: string): Promise; isTaskMode(): boolean; hasPendingClarification(): boolean; isActiveTab(tab: 'task' | 'chat' | 'suggestions'): boolean; setActiveTab(tab: 'task' | 'chat' | 'suggestions'): void; onTabsKeydown(event: KeyboardEvent): void; private focusTab; getTaskTitle(): string; getTaskSubtitle(): string; getTaskPrimaryLabel(): string; getTaskSecondaryLabel(): string; getTaskCancelLabel(): string; isTaskPrimaryDisabled(): boolean; isBusyState(): boolean; getSystemStatusLabel(): string; getSystemStatusDetail(): string; shouldShowSystemStatusDetail(): boolean; getSystemStatusAriaLive(): 'polite' | 'assertive'; shouldShowSnapshotFallbackBadge(): boolean; getRiskPolicyLabel(): string; getRiskPolicyTooltip(): string; isStrictRiskPolicy(): boolean; getFlowStepState(step: number): 'done' | 'active' | 'pending'; getFlowStepDetail(step: number): string; shouldShowTaskFlow(): boolean; shouldShowThoughtCard(): boolean; getThoughtTimingLabel(): string; getThoughtSummary(): string; getThoughtPlanTitle(): string; getThoughtChecklist(): string[]; openThoughtDetails(): void; openThoughtPreview(): void; getThoughtDetailsTooltip(): string; getThoughtDetailsLabel(): string; getThoughtPreviewTooltip(): string; getThoughtActionHint(): string; shouldShowThoughtPreviewAction(): boolean; shouldShowTaskTimeline(): boolean; getTaskTimelineItems(): Array<{ step: number; title: string; detail: string; state: 'done' | 'active' | 'pending'; }>; private getThoughtDurationSeconds; private formatDurationClock; private formatWesternTwoDigits; getReviewRiskLevel(): ReviewRiskLevel; getReviewSummary(): string; getDiffToggleLabel(): string; private getReviewChangeCount; private estimatePatchChangeCount; private getCurrentFlowStep; private resolveCurrentFlowStepFromStream; private shouldUseStreamTimeline; private initializeStreamTimeline; private markStreamStep; shouldShowTaskSteps(): boolean; getTaskSelectionSummary(): string | null; getHistorySessionTooltip(session: { componentType?: string; componentId?: string; }): string; getVisibleSuggestions(): AiSuggestion[]; hasDismissedSuggestions(): boolean; getDismissedSuggestionCount(): number; restoreDismissedSuggestions(): void; isDatasetSelection(): boolean; hasClarificationSelection(): boolean; confirmTaskAction(): void; handleTaskSecondary(): void; onClarificationOptionClick(opt: ClarificationRichOption): void; toggleManualInput(): void; private toggleClarificationSelection; private setState; private flashThoughtDetails; private clearThoughtDetailsHighlightTimer; private focusTaskPanelTarget; toggleFullDiff(): void; getDiffSummaryLines(): string[]; private summarizeDiff; shouldShowApplyDetails(): boolean; getApplyPaths(): string[]; getEditablePatchPathEdits(): PatchPathEdit[]; togglePatchEditor(): void; resetPatchEditor(): void; togglePatchPathEditor(): void; resetPatchPathEdits(): void; applyPathEditsToPatch(): boolean; reapplyPathEdits(): Promise; reapplyEditedPatch(): Promise; private confirmEditedPatchBeforeApply; getScopeLabel(): string; getScopeTooltip(): string; getConfidenceLabel(): string; getConfidenceTooltip(): string; isClarificationSelected(option: ClarificationRichOption): boolean; getClarificationOptionLayout(option: ClarificationRichOption): 'endpoint' | 'color' | 'description' | 'default'; getClarificationOptionKindLabel(option: ClarificationRichOption): string; isEndpointOption(option: ClarificationRichOption): boolean; isColorOption(option: ClarificationRichOption): boolean; hasRichDescription(option: ClarificationRichOption): boolean; getEndpointIcon(option: ClarificationRichOption): string; getEndpointMethod(option: ClarificationRichOption): string | null; getEndpointPath(option: ClarificationRichOption): string | null; shouldShowClarificationTooltip(option: ClarificationRichOption): boolean; getClarificationTooltip(option: ClarificationRichOption): string; getSafeHexColor(option: ClarificationRichOption): string | null; shouldShowDescriptionTooltip(option: ClarificationRichOption): boolean; getDescriptionTooltip(option: ClarificationRichOption): string; shouldShowDescription(option: ClarificationRichOption): boolean; handleClarificationOption(option: ClarificationRichOption | string): Promise; confirmPatch(): Promise; private requiresApplyConfirmation; private confirmRiskApply; private buildRiskConfirmationMessage; private openConfirmationDialog; private normalizeRiskLevel; undoLastChange(): Promise; retry(): void; private applyPatchPayload; private parsePatchEditorText; private collectPatchPaths; private serializePatch; private syncPatchPathEdits; private serializePathValue; private collectEditablePatchPaths; private parsePathEditValue; private getPatchValueAtPath; private setPatchValueAtPath; private tokenizePatchPath; private clonePatch; prepareSuggestionPrompt(sug: AiSuggestion, event?: Event): void; dismissSuggestion(sug: AiSuggestion, event?: Event): void; onSuggestionCardKeydown(event: KeyboardEvent, sug: AiSuggestion): void; selectSuggestion(sug: AiSuggestion): void; refreshSuggestions(): Promise; submitClarificationSelection(): Promise; startNewSession(resetUi?: boolean): void; clearHistory(): Promise; removeHistorySession(sessionId: string, event?: Event): Promise; onHistorySessionCardKeydown(event: KeyboardEvent, sessionId: string): void; reuseHistorySessionPrompt(sessionId: string, event?: Event): void; undoRemoveHistorySession(): void; selectHistorySession(sessionId: string): void; private loadSuggestions; private getPatchViaStreamWithFallback; private consumePatchStream; private applyStreamEvent; private resolveStreamTimeoutMs; private resolveStreamIdleTimeoutMs; private acceptStreamEvent; private resolveLastEventIdForStream; private extractStreamMessage; private resolveStreamStepFromPhase; private requestStreamCancel; private closeActiveStreamConnection; private resetStreamTracking; private shouldFallbackToPatch; private compileAdapterResponse; private handlePatchResponse; private initHistory; private buildHistoryWarnings; private matchesHistoryContext; private buildClientTurnId; private buildUiContextRef; private buildCurrentStateDigest; private inferAiMode; private resolveRouteKey; private resolveSchemaHash; private checkSessionStorage; private resolveSessionStorageKey; private restoreServerSessionId; private persistServerSessionId; private appendHistoryMessage; private appendHistoryAssistantResponse; private resolveAssistantSummary; private isProcessingMessage; retryProcessing(): Promise; private cancelProcessing; private withSnapshotFallbackDetail; private resolveUsedRag; private sliceHistoryMessages; private applyClarificationUi; private resolveClarificationPresentation; private resetAssistantStateForSession; private setHistoryUndo; private clearPendingHistoryUndo; private clearHistoryUndoTimer; private pruneDismissedSuggestions; private confirmHistoryClear; private enterClarification; private enterClarificationWithOptions; private enterClarificationWithQuestions; private resolveClarificationOptions; private enrichClarification; private buildClarificationAnswers; private needsRuleClarification; private needsValueColorClarification; private needsBadgeValueClarification; private normalizeMissingContext; private resolveBadgeContextHints; private hasBadgeValues; private hasBadgeColors; private hasBadgeField; private mergeContextHints; private enrichDomainCatalogAuthoringHints; private setResourcePathHint; private clearResourcePathHint; private matchClarificationOptionPath; private normalizeResourcePath; private extractResourcePath; private asRecord; private toAiJsonObject; private toAiJsonValue; private toClarificationContextHints; private firstNonBlank; private buildRuleClarificationPayloads; private buildValueColorClarificationPayloads; private resolveBadgeValuesContext; private resolveSchemaField; private extractSchemaValues; private extractOptionValueFromSchema; private normalizeOptionKey; private normalizeStringList; private buildValueColorMap; private findColumnInPrompt; private extractOptionValue; private resolveComponentId; private resolveComponentType; private buildSuggestionsRequest; private resolveLocale; private resolveConfigRoot; private resolveMockMode; private resolveConfiguredRiskPolicy; private getEffectiveRiskPolicy; private normalizeRiskPolicy; private hasProviderOverride; private resolveMockModeFromStatus; private loadTemplateVariants; private extractVariantIds; private resolveVariantIdForSuggestion; private mapSuggestionToVariantId; private getTemplateVariants; private includesAny; private buildSuggestionsCacheKey; private stableStringify; private hashString; private isTable; private isForm; private extractColumnNames; private extractFieldNames; onKeydown(event: KeyboardEvent): void; private shouldSubmitFromKeydown; private restoreFocusToTrigger; private normalizeError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw'; type QuickReplyPresentationItem = PraxisAssistantShellQuickReplyPresentationItem & { key: 'bestFor' | 'returns' | 'nextStep' | string; icon: string; }; interface QuickReplyContextChip { icon: string; value: string; ariaLabel: string; } type AssistantContentBlock = Readonly>; interface AssistantContentResourceField { name: string; label: string; description: string; } interface AssistantContentResource { id: string; label: string; description: string; role: string; resourcePath: string; fields: readonly AssistantContentResourceField[]; evidence: readonly string[]; } declare class PraxisAiAssistantShellComponent implements AfterViewInit, OnChanges, OnDestroy { labels: Partial | null; mode: PraxisAssistantShellMode; state: PraxisAssistantShellState; contextItems: readonly PraxisAssistantShellContextItem[]; attachments: readonly PraxisAssistantShellAttachment[]; messages: readonly PraxisAssistantShellMessage[]; quickReplies: readonly PraxisAssistantShellQuickReply[]; recommendedIntents: readonly PraxisAssistantRecommendedIntent[]; prompt: string; statusText: string; errorText: string; testIdPrefix: string; panelTestId: string; submitTestId: string; applyTestId: string; primaryAction: PraxisAssistantShellAction | null; secondaryActions: readonly PraxisAssistantShellAction[]; governanceActions: readonly PraxisAssistantShellAction[]; busy: boolean; canSubmit: boolean; canApply: boolean; submitOnEnter: boolean; showAttachAction: boolean; enablePastedAttachments: boolean; enableFileAttachments: boolean; attachmentAccept: string; attachmentMultiple: boolean; private readonly defaultVoiceInputMode; private readonly defaultVoiceLanguage; voiceInputMode: PraxisAssistantVoiceInputMode; voiceLanguage: string; draggable: boolean; resizable: boolean; minWidth: number; minHeight: number; margin: number; layout: PraxisAssistantShellLayout; promptChange: EventEmitter; submitPrompt: EventEmitter; apply: EventEmitter; retryTurn: EventEmitter; cancelTurn: EventEmitter; shellAction: EventEmitter; close: EventEmitter; attach: EventEmitter; attachmentsPasted: EventEmitter; attachmentsSelected: EventEmitter; removeAttachment: EventEmitter; messageAction: EventEmitter<{ message: PraxisAssistantShellMessage; action: PraxisAssistantShellMessageAction; }>; editMessage: EventEmitter; resendMessage: EventEmitter; quickReply: EventEmitter; recommendedIntent: EventEmitter; layoutChange: EventEmitter; panel?: ElementRef; conversation?: ElementRef; promptInput?: ElementRef; private readonly cdr; private readonly injector; private readonly browserSpeech; private readonly governedSpeech; protected currentPrompt: string; protected resolvedLabels: PraxisAssistantShellLabels; protected voiceCaptureState: PraxisAssistantVoiceCaptureState; protected voiceFeedbackText: string; protected currentLayout: PraxisAssistantShellLayout; protected readonly resizeHandles: readonly ResizeDirection[]; private pointerSession; private readonly ownedPreviewUrls; private readonly submittedFeedbackObservationIds; private voiceCaptureSequence; private destroyed; private processingStartedAt; private processingElapsedSeconds; private processingTimer; private readonly onWindowPointerMove; private readonly onWindowPointerUp; ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; protected onViewportResize(): void; protected onPromptInput(value: string): void; protected resizePromptToContent(): void; protected onSubmit(): void; protected onPromptKeydown(event: KeyboardEvent): void; protected onPromptPaste(event: ClipboardEvent): void; protected onVoiceInputClick(): void; protected shouldShowVoiceInput(): boolean; protected isVoiceInputDisabled(): boolean; protected isVoiceInputBusy(): boolean; protected getVoiceActionLabel(): string; protected shouldShowVoiceFeedback(): boolean; private canUseBrowserSpeech; private cancelVoiceCapture; private isCurrentVoiceCapture; private activeVoiceService; private applyVoiceTranscript; private schedulePromptResize; private resolveVoiceErrorText; private getVoiceLabel; protected onAttachClick(fileInput: HTMLInputElement): void; protected onAttachmentFilesSelected(event: Event): void; protected onApply(): void; protected renderMessageText(text: string | null | undefined): string; protected hasStructuredAssistantContent(message: PraxisAssistantShellMessage): boolean; protected getAssistantContentBlocks(message: PraxisAssistantShellMessage): readonly AssistantContentBlock[]; protected getAssistantContentBlockType(block: AssistantContentBlock): string; protected getAssistantContentBlockTitle(block: AssistantContentBlock, fallback?: string): string; protected getAssistantContentBlockText(block: AssistantContentBlock): string; protected getAssistantContentResources(block: AssistantContentBlock): readonly AssistantContentResource[]; protected getAssistantContentResourceFields(resource: Record): readonly AssistantContentResourceField[]; protected getAssistantContentResourceMeta(resource: AssistantContentResource): readonly string[]; protected trackAssistantContentBlock(index: number, block: AssistantContentBlock): string; protected trackAssistantContentResource(index: number, resource: AssistantContentResource): string; protected trackAssistantContentField(index: number, field: AssistantContentResourceField): string; protected trackAssistantContentValue(_index: number, value: string): string; private isSupportedAssistantContentBlock; private getStringArray; private renderInlineMarkdown; private escapeHtml; protected shouldShowStatusText(): boolean; protected shouldShowErrorText(): boolean; protected getAuxiliaryStatusText(): string; protected onShellAction(action: PraxisAssistantShellAction): void; protected getPrimaryAction(): PraxisAssistantShellAction; protected getSecondaryActions(): readonly PraxisAssistantShellAction[]; protected getPrimaryActionTooltip(action: PraxisAssistantShellAction): string; protected isShellActionDisabled(action: PraxisAssistantShellAction): boolean; protected getShellActionTone(action: PraxisAssistantShellAction): string; protected trackShellAction(_index: number, action: PraxisAssistantShellAction): string; private hasRecoverableTurn; private updateProcessingTimer; private stopProcessingTimer; private getProcessingStatusText; private shouldShowAuxiliaryText; private normalizeMessageText; private getDefaultPrimaryAction; protected onQuickReply(reply: PraxisAssistantShellQuickReply): void; protected shouldShowRecommendedIntents(): boolean; protected onRecommendedIntent(intent: PraxisAssistantRecommendedIntent): void; protected isRecommendedIntentDisabled(intent: PraxisAssistantRecommendedIntent): boolean; protected getRecommendedIntentAriaLabel(intent: PraxisAssistantRecommendedIntent): string; protected getRecommendedIntentDescription(intent: PraxisAssistantRecommendedIntent): string; protected getRecommendedIntentCtaLabel(intent: PraxisAssistantRecommendedIntent): string; protected getRecommendedIntentIcon(intent: PraxisAssistantRecommendedIntent): string; protected getRecommendedIntentTone(intent: PraxisAssistantRecommendedIntent): string; protected getRecommendedIntentGroupLabel(intent: PraxisAssistantRecommendedIntent): string; protected getQuickReplyAriaLabel(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyLabel(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyTechnicalDetails(reply: PraxisAssistantShellQuickReply): string; protected isRichQuickReply(reply: PraxisAssistantShellQuickReply): boolean; protected shouldUseInlineQuickReplies(): boolean; protected getQuickReplyDescription(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyContextChips(reply: PraxisAssistantShellQuickReply): readonly QuickReplyContextChip[]; protected getQuickReplyPresentationItems(reply: PraxisAssistantShellQuickReply): readonly QuickReplyPresentationItem[]; private defaultQuickReplyPresentation; protected getQuickReplyCategoryLabel(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyIcon(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyCtaLabel(reply: PraxisAssistantShellQuickReply): string; protected getQuickReplyTone(reply: PraxisAssistantShellQuickReply): string; private normalizeQuickReplyTone; private asRecord; private stringHint; private quickReplyHint; private quickReplyPublicResourceLabel; private isPublicDisplayText; private hasQuickReplyResourceContext; private isFieldDiscoveryQuickReply; protected isContextualPreviewActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean; protected isSourceReviewQuickReply(reply: PraxisAssistantShellQuickReply): boolean; protected isGuidedActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean; protected isConversationQuickActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean; private quickReplyPresentation; private quickReplyPresentationKind; private presentationEvidenceToChip; private getContextualActionChips; private publicQuickReplyHint; private isGenericContextualActionDescription; private trimSentencePunctuation; private shortPathLabel; private knownPublicResourceLabel; private shortTechnicalLabel; private friendlyTechnicalLabel; private normalizePortugueseDisplayText; protected getCloseIcon(): string; protected getContextItemValue(item: PraxisAssistantShellContextItem): string; private normalizeShellAction; protected onRemoveAttachment(attachment: PraxisAssistantShellAttachment): void; protected onMessageAction(message: PraxisAssistantShellMessage, action: PraxisAssistantShellMessageAction): void; protected canSendMessageFeedback(message: PraxisAssistantShellMessage): boolean; protected isMessageFeedbackSubmitted(message: PraxisAssistantShellMessage): boolean; protected sendMessageFeedback(message: PraxisAssistantShellMessage, rating: AiAssistantObservationFeedbackRatingValue): void; private resolveAiApi; protected getMessageActionIcon(action: PraxisAssistantShellMessageAction): string; protected getMessageActionLabel(action: PraxisAssistantShellMessageAction): string; protected isMessageActionIconOnly(action: PraxisAssistantShellMessageAction): boolean; protected getModeLabel(): string; protected getStateLabel(): string; protected startDrag(event: PointerEvent): void; protected startResize(direction: ResizeDirection, event: PointerEvent): void; protected trackResizeHandle(_index: number, direction: ResizeDirection): ResizeDirection; protected trackMessage(_index: number, message: PraxisAssistantShellMessage): string; protected trackMessageAction(_index: number, action: PraxisAssistantShellMessageAction): string; protected trackQuickReply(_index: number, reply: PraxisAssistantShellQuickReply): string; protected trackRecommendedIntent(_index: number, intent: PraxisAssistantRecommendedIntent): string; protected trackContextItem(_index: number, item: PraxisAssistantShellContextItem): string; protected trackAttachment(_index: number, attachment: PraxisAssistantShellAttachment): string; private startPointerSession; private handlePointerMove; private resizeLayout; private finishPointerSession; private detachPointerListeners; private resolveViewportBounds; private normalizeLayout; private clampLayout; private clampToViewport; private effectiveMinimum; private clamp; private scheduleConversationScroll; private fileAttachment; private createAttachmentId; private attachmentKind; private revokeDetachedPastedPreviewUrls; private revokeAllOwnedPreviewUrls; private revokeOwnedPreviewUrl; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const PRAXIS_ASSISTANT_VOICE_INPUT_MODE: InjectionToken; declare const PRAXIS_ASSISTANT_VOICE_LANGUAGE: InjectionToken; type PraxisAssistantDockTone = 'ready' | 'working' | 'review' | 'governed' | 'error'; declare class PraxisAiAssistantDockComponent { title: string; summary: string; badge: string; icon: string; state: PraxisAssistantShellState | null; tone: PraxisAssistantDockTone | null; ariaLabel: string; openAriaLabel: string; openTooltip: string; testId: string; openTestId: string; open: EventEmitter; resolvedTone(): PraxisAssistantDockTone; resolvedIcon(): string; resolvedBadge(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class PraxisAiAssistantSessionHostComponent { private readonly registry; testId: string; dockTestIdPrefix: string; ariaLabel: string; openAriaLabel: string; openTooltip: string; ownerType: string | null; ownerId: string | null; visibility: PraxisAssistantSessionVisibility | 'all'; includeOriginAnchored: boolean; sessionOpen: EventEmitter; visibleSessions(): readonly PraxisAssistantSessionSnapshot[]; openSession(sessionId: string): void; sessionAriaLabel(session: PraxisAssistantSessionSnapshot): string; dockTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string; dockOpenTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string; trackSession(_index: number, session: PraxisAssistantSessionSnapshot): string; private safeId; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_includeOriginAnchored: unknown; } declare class AiContextBuilderService { private schemaMinifier; constructor(schemaMinifier: SchemaMinifierService); /** * Builds the complete context for the AI prompt */ buildPromptContext(fieldSchemas: Record, targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', propertySchema: RulePropertySchema): PromptContext; buildRulePrompt(userPrompt: string, context: PromptContext): string; buildSuggestionPrompt(context: PromptContext): string; /** * Formats available properties by targetType */ private formatProperties; /** * Lists JSON Logic operators with examples */ private formatOperators; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface AiWizardData { fieldSchemas: Record; targetSchemas?: any; propertySchema: RulePropertySchema; } type WizardStep = 'prompt' | 'review'; declare class AiRuleWizardDialogComponent implements OnInit { dialogRef: MatDialogRef; data: AiWizardData; private aiService; private validator; private snackBar; private contextBuilder; private cdr; selectedTargetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock'; userPrompt: string; isGenerating: boolean; validationError: string | null; loadingSuggestions: boolean; suggestions: string[]; private suggestionsCache; private suggestionsRequestId; currentStep: WizardStep; generatedResponse: AiRuleResponse | null; warnings: AiValidationWarning[]; loadingMessages: string[]; currentLoadingMessage: string; streamingText: string; private loadingInterval; constructor(dialogRef: MatDialogRef, data: AiWizardData, aiService: PraxisAiService, validator: AiResponseValidatorService, snackBar: MatSnackBar, contextBuilder: AiContextBuilderService, cdr: ChangeDetectorRef); ngOnInit(): void; onTargetTypeChange(): void; getAvailableProperties(): _praxisui_ai.RulePropertyDefinition[]; loadSuggestions(forceRefresh?: boolean): Promise; reloadSuggestions(): void; applySuggestion(text: string): void; generate(): Promise; private startLoadingUX; private stopLoadingUX; backToPrompt(): void; confirm(): void; getProps(obj: any): { key: string; value: any; }[]; hasProps(obj: any): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { AI_BACKEND_CONFIG_STORE, AI_BACKEND_ENDPOINTS, AI_BACKEND_STORAGE_OPTIONS, AI_CONTRACT_SCHEMA_HASH, AI_CONTRACT_VERSION, AI_INTENT_CONTRACT_SCHEMA_HASH, AI_INTENT_CONTRACT_VERSION, AI_STREAM_EVENT_SCHEMA_VERSION, AI_STREAM_EVENT_TYPES, AgenticAuthoringTurnClientService, AiBackendApiService, AiPatchStreamConnectionError, AiResponseValidatorService, AiRuleWizardDialogComponent, BaseAiAdapter, PRAXIS_ASSISTANT_CONTEXT_ATTACHMENT_LIMIT, PRAXIS_ASSISTANT_CONTEXT_ITEM_LIMIT, PRAXIS_ASSISTANT_CONTEXT_SCHEMA_FIELD_LIMIT, PRAXIS_ASSISTANT_CONTEXT_TEXT_LIMIT, PRAXIS_ASSISTANT_VOICE_INPUT_MODE, PRAXIS_ASSISTANT_VOICE_LANGUAGE, PRAXIS_AUTHORING_SCOPE_POLICY_KIND, PRAXIS_AUTHORING_SCOPE_POLICY_VERSION, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantDockComponent, PraxisAiAssistantSessionHostComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, PraxisGovernedAudioTranscriptionService, SchemaMinifierService, createAuthoringScopePolicyContext, createAuthoringScopePolicySystemMessage, createComponentAuthoringContext, createPraxisAssistantViewportLayout, normalizeAuthoringPrompt, normalizePraxisAssistantAttachmentSummary, normalizePraxisAssistantContextSnapshot, sanitizePraxisAssistantText, shouldRoutePromptToGovernedDecision, submitPraxisAssistantQuickReply, toAiJsonObject, toPraxisAssistantClarificationOption, toPraxisAssistantConversationMessages, withAuthoringScopePolicy, withAuthoringScopePolicyContextHints, withAuthoringScopePolicyMessage }; export type { AgenticAuthoringApplyRequestContract, AgenticAuthoringApplyResultContract, AgenticAuthoringApplyTargetContract, AgenticAuthoringAttachmentSummaryContract, AgenticAuthoringCandidateContract, AgenticAuthoringClientActionContract, AgenticAuthoringComponentCapabilitiesResultContract, AgenticAuthoringComponentCapabilityCatalogContract, AgenticAuthoringComponentCapabilityContract, AgenticAuthoringComponentCapabilityDiagnosticsContract, AgenticAuthoringComponentCapabilityExampleContract, AgenticAuthoringComponentFieldAliasContract, AgenticAuthoringConversationContextContract, AgenticAuthoringConversationMessageContract, AgenticAuthoringIntentResolutionRequestContract, AgenticAuthoringIntentResolutionResultContract, AgenticAuthoringManifestCompileResult, AgenticAuthoringManifestCompileResultContract, AgenticAuthoringManifestEditPlanRequest, AgenticAuthoringManifestEditPlanRequestContract, AgenticAuthoringManifestValidationResult, AgenticAuthoringManifestValidationResultContract, AgenticAuthoringPendingClarificationContract, AgenticAuthoringPlanRequestContract, AgenticAuthoringPreviewResultContract, AgenticAuthoringQuickReplyContract, AgenticAuthoringResolveTargetRequest, AgenticAuthoringResolveTargetRequestContract, AgenticAuthoringResolvedTarget, AgenticAuthoringResolvedTargetContract, AgenticAuthoringResourceCandidatesRequestContract, AgenticAuthoringResourceCandidatesResultContract, AgenticAuthoringSemanticDecisionContract, AgenticAuthoringTurnClientEvent, AgenticAuthoringTurnClientOptions, AgenticAuthoringTurnLifecycleEvent, AgenticAuthoringTurnStreamConnection, AgenticAuthoringTurnStreamConnectionOptions, AgenticAuthoringTurnStreamContextHintsContract, AgenticAuthoringTurnStreamEnvelope, AgenticAuthoringTurnStreamEnvelopeContract, AgenticAuthoringTurnStreamEnvelopeEvent, AgenticAuthoringTurnStreamLifecycle, AgenticAuthoringTurnStreamRequest, AgenticAuthoringTurnStreamRequestContract, AgenticAuthoringTurnStreamStartOptions, AgenticAuthoringTurnStreamStartResponse, AgenticAuthoringTurnStreamStartResponseContract, AgenticAuthoringTurnStreamStartedEvent, AiAssistantObservationFeedbackRating, AiAssistantObservationFeedbackRatingValue, AiAssistantObservationFeedbackRequest, AiAssistantObservationFeedbackRequestContract, AiAssistantObservationFeedbackResponse, AiAssistantObservationFeedbackResponseContract, AiAssistantObservationResponseContract, AiAssistantObservationSummaryResponseContract, AiAssistantObservationSummaryRowContract, AiAudioTranscriptionResponse, AiAuthoringResponseMode, AiAuthoringResponseModeKind, AiBackendConfigStore, AiBackendEndpoints, AiBackendStorageOptions, AiChatMessage, AiChatMessageContract, AiClarificationUiContract, AiComponentAuthoringContract, AiConfigAdapter, AiConsultativeAuthoringContext, AiContextDTO, AiContextHintsContract, AiContextTemplate, AiContextTemplateMeta, AiCurrentStateDigest, AiCurrentStateDigestContract, AiDomainCatalogContextHintContract, AiDomainCatalogContextHintIntent, AiDomainCatalogContextHintItemType, AiDomainCatalogRelationshipHintContract, AiExamplePair, AiGlobalConfigSnapshot, AiGovernedDecisionRoutingOptions, AiHeaderContext, AiIntegrationConfig, AiJsonArray, AiJsonObject, AiJsonPrimitive, AiJsonValue, AiMemoryInfoContract, AiModel, AiOptionContract, AiOrchestratorRequest, AiOrchestratorRequestContract, AiOrchestratorResponse, AiOrchestratorResponseContract, AiOrchestratorResponseType, AiPatchDiff, AiPatchDiffContract, AiPatchStreamCancelResponse, AiPatchStreamCancelResponseContract, AiPatchStreamConnection, AiPatchStreamConnectionErrorKind, AiPatchStreamEnvelope, AiPatchStreamEnvelopeContract, AiPatchStreamEventType, AiPatchStreamStartResponse, AiPatchStreamStartResponseContract, AiProviderCatalogItem, AiProviderCatalogResponse, AiProviderModelsRequest, AiProviderModelsResponse, AiProviderStatusResponse, AiProviderTestRequest, AiProviderTestResponse, AiResponseCompileResult, AiRuleResponse, AiSchemaContext, AiSchemaContextContract, AiSuggestion, AiSuggestionsRequest, AiSuggestionsResponse, AiTurnStreamEventType, AiUiContextRef, AiUiContextRefContract, AiValidationError, AiValidationResult, AiValidationWarning, AiWizardData, Capability, FieldSchemaLike, MinifiedField, PatchResult, PraxisAssistantActionContract, PraxisAssistantActionKind, PraxisAssistantAttachmentKind, PraxisAssistantAttachmentSummary, PraxisAssistantAuthoringManifestRef, PraxisAssistantCapabilityRef, PraxisAssistantClarificationOption, PraxisAssistantClarificationQuestion, PraxisAssistantClarificationQuestionType, PraxisAssistantComponentType, PraxisAssistantContextItem, PraxisAssistantContextMode, PraxisAssistantContextSessionDescriptor, PraxisAssistantContextSnapshot, PraxisAssistantConversationMessage, PraxisAssistantConversationMessageRole, PraxisAssistantDigest, PraxisAssistantDockTone, PraxisAssistantGovernanceHint, PraxisAssistantIdentity, PraxisAssistantOpenRequest, PraxisAssistantOpportunityCandidate, PraxisAssistantOpportunityCandidateStatus, PraxisAssistantOpportunityCatalog, PraxisAssistantOpportunityEvidence, PraxisAssistantOpportunityGroup, PraxisAssistantOpportunityMissingContext, PraxisAssistantOpportunitySafety, PraxisAssistantOpportunityTarget, PraxisAssistantOwnerType, PraxisAssistantPendingClarification, PraxisAssistantRecommendedIntent, PraxisAssistantRecommendedIntentAction, PraxisAssistantRecommendedIntentPresentation, PraxisAssistantRecommendedIntentTone, PraxisAssistantRiskLevel, PraxisAssistantSessionDescriptor, PraxisAssistantSessionIdentityRef, PraxisAssistantSessionPresence, PraxisAssistantSessionSnapshot, PraxisAssistantSessionVisibility, PraxisAssistantShellAction, PraxisAssistantShellActionTone, PraxisAssistantShellAttachment, PraxisAssistantShellContextItem, PraxisAssistantShellLabels, PraxisAssistantShellLayout, PraxisAssistantShellMessage, PraxisAssistantShellMessageAction, PraxisAssistantShellMessageRole, PraxisAssistantShellMode, PraxisAssistantShellQuickReply, PraxisAssistantShellQuickReplyEvidence, PraxisAssistantShellQuickReplyPresentation, PraxisAssistantShellQuickReplyPresentationItem, PraxisAssistantShellQuickReplyPresentationKind, PraxisAssistantShellState, PraxisAssistantTargetKind, PraxisAssistantTargetRef, PraxisAssistantTurnAction, PraxisAssistantTurnControllerOptions, PraxisAssistantTurnFlow, PraxisAssistantTurnPhase, PraxisAssistantTurnRequest, PraxisAssistantTurnResult, PraxisAssistantTurnViewState, PraxisAssistantViewportLayoutOptions, PraxisAssistantVoiceCaptureState, PraxisAssistantVoiceInputMode, PraxisAuthoringScopeChatMessage, PraxisAuthoringScopePolicyOptions, PraxisAuthoringScopePolicyRequest, ProblemResponseContract, PromptContext, RulePropertyDefinition, RulePropertySchema, RulePropertyType, ValidationContext, ValueKind };