@praxisui/ai 8.0.0-beta.0 → 8.0.0-beta.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2591 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, OnDestroy, ElementRef, OnChanges, EventEmitter, SimpleChanges, OnInit, ChangeDetectorRef } from '@angular/core';
3
+ import * as rxjs from 'rxjs';
4
+ import { Observable } from 'rxjs';
5
+ import { Schema } from '@google/generative-ai';
6
+ import { ConnectedPosition, CdkOverlayOrigin } from '@angular/cdk/overlay';
7
+ import * as _praxisui_ai from '@praxisui/ai';
8
+ import { MatDialogRef } from '@angular/material/dialog';
9
+ import { MatSnackBar } from '@angular/material/snack-bar';
10
+
11
+ declare class PraxisAi {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAi, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisAi, "lib-praxis-ai", never, {}, {}, never, never, true, never>;
14
+ }
15
+
16
+ /**
17
+ * Generated from praxis-config-starter/docs/ai/contracts/praxis-ai-api-contract-v1.1.openapi.yaml.
18
+ * Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js.
19
+ */
20
+ declare const AI_CONTRACT_VERSION: "v1.1";
21
+ declare const AI_CONTRACT_SCHEMA_HASH: "41767dafdf6ebea802c083d77187ad6612937d6831188938dc21adce384b57a2";
22
+ declare const AI_STREAM_EVENT_SCHEMA_VERSION: "v1";
23
+ declare const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION: "praxis.ai.context-hints.domain-catalog/v0.2";
24
+ declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "result", "error", "cancelled"];
25
+ type AiJsonPrimitive = string | number | boolean | null;
26
+ type AiJsonArray = AiJsonValue[];
27
+ interface AiJsonObject {
28
+ [key: string]: AiJsonValue;
29
+ }
30
+ type AiJsonValue = AiJsonPrimitive | AiJsonObject | AiJsonArray;
31
+ type AiDomainCatalogContextHintItemType = 'context' | 'node' | 'edge' | 'binding' | 'evidence' | 'governance' | 'vocabulary' | 'relationship';
32
+ type AiDomainCatalogContextHintIntent = 'authoring' | 'explain' | 'validate' | 'ai-access-control';
33
+ type AiDomainCatalogRecommendedAuthoringFlow = 'shared_rule_authoring' | 'component_authoring' | 'ui_composition_authoring';
34
+ type AiDomainCatalogRecommendedRuleType = 'privacy' | 'compliance' | 'validation' | 'selection_eligibility' | 'workflow_action_policy' | 'approval_policy' | string;
35
+ interface AiDomainCatalogRelationshipHintContract {
36
+ enabled?: boolean;
37
+ federated?: boolean;
38
+ serviceKey?: string | null;
39
+ sourceNodeKey?: string | null;
40
+ targetNodeKey?: string | null;
41
+ edgeType?: string | null;
42
+ query?: string | null;
43
+ limit?: number;
44
+ }
45
+ interface AiDomainCatalogContextHintContract {
46
+ schemaVersion?: typeof AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION;
47
+ serviceKey?: string;
48
+ resourceKey?: string | null;
49
+ releaseId?: string | null;
50
+ releaseKey?: string | null;
51
+ type?: AiDomainCatalogContextHintItemType;
52
+ itemTypes?: AiDomainCatalogContextHintItemType[];
53
+ intent?: AiDomainCatalogContextHintIntent | null;
54
+ query?: string | null;
55
+ contextKey?: string | null;
56
+ nodeType?: string | null;
57
+ recommendedAuthoringFlow?: AiDomainCatalogRecommendedAuthoringFlow | null;
58
+ recommendedRuleType?: AiDomainCatalogRecommendedRuleType | null;
59
+ limit?: number;
60
+ relationships?: AiDomainCatalogRelationshipHintContract | null;
61
+ }
62
+ interface AiContextHintsContract {
63
+ domainCatalog?: AiDomainCatalogContextHintContract;
64
+ [key: string]: AiJsonValue | AiDomainCatalogContextHintContract | undefined;
65
+ }
66
+ interface AiSchemaContextContract {
67
+ path?: string | null;
68
+ operation?: string | null;
69
+ schemaType?: string | null;
70
+ }
71
+ interface AiChatMessageContract {
72
+ role: 'user' | 'assistant' | 'system';
73
+ content: string;
74
+ }
75
+ interface AiUiContextRefContract {
76
+ componentType?: string | null;
77
+ componentId?: string | null;
78
+ routeKey?: string | null;
79
+ schemaHash?: string | null;
80
+ variantId?: string | null;
81
+ }
82
+ interface AiCurrentStateDigestContract {
83
+ columns?: string[] | null;
84
+ sort?: string | null;
85
+ rowCount?: number | null;
86
+ }
87
+ interface AiOrchestratorRequestContract {
88
+ componentId: string;
89
+ componentType: string;
90
+ userPrompt?: string;
91
+ sessionId?: string;
92
+ mode?: 'new' | 'continue';
93
+ clientTurnId?: string;
94
+ messages?: AiChatMessageContract[];
95
+ summary?: string;
96
+ uiContextRef?: AiUiContextRefContract;
97
+ currentStateDigest?: AiCurrentStateDigestContract;
98
+ currentState: AiJsonObject;
99
+ dataProfile?: AiJsonObject | null;
100
+ schemaFields?: AiJsonObject[] | null;
101
+ runtimeState?: AiJsonObject | null;
102
+ suggestedPatch?: AiJsonObject | null;
103
+ contextHints?: AiContextHintsContract | null;
104
+ aiMode?: string;
105
+ requireSchema?: boolean;
106
+ resourcePath?: string;
107
+ contractVersion?: string;
108
+ schemaHash?: string;
109
+ schemaContext?: AiSchemaContextContract | null;
110
+ variantId?: string;
111
+ apiMethod?: string;
112
+ apiTags?: string;
113
+ apiSearchLimit?: number;
114
+ observationId?: string;
115
+ }
116
+ type AiOrchestratorResponseType = 'patch' | 'clarification' | 'error' | 'info';
117
+ interface AiPatchDiffContract {
118
+ path: string;
119
+ before?: AiJsonValue;
120
+ after?: AiJsonValue;
121
+ }
122
+ interface AiOptionContract {
123
+ value?: string | null;
124
+ label?: string | null;
125
+ example?: string | null;
126
+ contextHints?: AiContextHintsContract | null;
127
+ }
128
+ interface AiClarificationUiContract {
129
+ responseType?: 'text' | 'choice' | 'confirm' | 'mixed' | 'context';
130
+ selectionMode?: 'single' | 'multiple';
131
+ presentation?: 'buttons' | 'list' | 'chips';
132
+ allowCustom?: boolean | null;
133
+ }
134
+ interface AiMemoryInfoContract {
135
+ summaryUpdated?: boolean | null;
136
+ windowSize?: number | null;
137
+ cached?: boolean | null;
138
+ }
139
+ interface AiOrchestratorResponseContract {
140
+ sessionId?: string | null;
141
+ code?: string | null;
142
+ type?: AiOrchestratorResponseType;
143
+ contractVersion?: string | null;
144
+ schemaHash?: string | null;
145
+ patch?: AiJsonObject | null;
146
+ componentEditPlan?: AiJsonObject | null;
147
+ diff?: AiPatchDiffContract[] | null;
148
+ explanation?: string | null;
149
+ warnings?: string[] | null;
150
+ message?: string | null;
151
+ options?: string[] | null;
152
+ optionPayloads?: AiOptionContract[] | null;
153
+ contextRequest?: number[] | null;
154
+ clarification?: AiClarificationUiContract;
155
+ componentId?: string | null;
156
+ componentType?: string | null;
157
+ path?: string | null;
158
+ providedValue?: AiJsonValue;
159
+ allowedValues?: string[] | null;
160
+ memory?: AiMemoryInfoContract;
161
+ observationId?: string | null;
162
+ }
163
+ type AiAssistantObservationFeedbackRating = 'positive' | 'negative' | 'inaccurate' | 'unsafe' | 'irrelevant' | 'incomplete';
164
+ interface AiAssistantObservationFeedbackRequestContract {
165
+ rating?: AiAssistantObservationFeedbackRating;
166
+ reasonCode?: string | null;
167
+ comment?: string | null;
168
+ }
169
+ interface AiAssistantObservationFeedbackResponseContract {
170
+ feedbackId?: string | null;
171
+ observationId?: string | null;
172
+ rating?: string | null;
173
+ reasonCode?: string | null;
174
+ commentPreview?: string | null;
175
+ createdAt?: string | null;
176
+ }
177
+ interface AiAssistantObservationResponseContract {
178
+ observationId?: string | null;
179
+ requestId?: string | null;
180
+ tenantId?: string | null;
181
+ environment?: string | null;
182
+ userId?: string | null;
183
+ surface?: string | null;
184
+ componentId?: string | null;
185
+ componentType?: string | null;
186
+ routeKey?: string | null;
187
+ variantId?: string | null;
188
+ schemaHash?: string | null;
189
+ contractVersion?: string | null;
190
+ sessionId?: string | null;
191
+ clientTurnId?: string | null;
192
+ threadId?: string | null;
193
+ turnId?: string | null;
194
+ streamId?: string | null;
195
+ promptHash?: string | null;
196
+ promptPreview?: string | null;
197
+ promptLength?: number | null;
198
+ admissionOutcome?: string | null;
199
+ terminalOutcome?: string | null;
200
+ qualityOutcome?: string | null;
201
+ errorCategory?: string | null;
202
+ errorCode?: string | null;
203
+ errorMessagePreview?: string | null;
204
+ provider?: string | null;
205
+ model?: string | null;
206
+ llmCallCount?: number | null;
207
+ latencyMs?: number | null;
208
+ createdAt?: string | null;
209
+ updatedAt?: string | null;
210
+ feedback?: AiAssistantObservationFeedbackResponseContract[];
211
+ }
212
+ interface AiAssistantObservationSummaryRowContract {
213
+ admissionOutcome?: string | null;
214
+ terminalOutcome?: string | null;
215
+ qualityOutcome?: string | null;
216
+ componentId?: string | null;
217
+ componentType?: string | null;
218
+ total?: number | null;
219
+ }
220
+ interface AiAssistantObservationSummaryResponseContract {
221
+ rows?: AiAssistantObservationSummaryRowContract[];
222
+ }
223
+ interface AgenticAuthoringConversationMessageContract {
224
+ id?: string | null;
225
+ role: 'user' | 'assistant' | 'system';
226
+ text?: string | null;
227
+ createdAt?: string | null;
228
+ }
229
+ interface AgenticAuthoringPendingClarificationContract {
230
+ sourcePrompt?: string | null;
231
+ questions?: string[];
232
+ assistantMessage?: string | null;
233
+ clientTurnId?: string | null;
234
+ diagnostics?: AiJsonObject | null;
235
+ }
236
+ interface AgenticAuthoringAttachmentSummaryContract {
237
+ id: string;
238
+ name: string;
239
+ kind: string;
240
+ mimeType?: string | null;
241
+ sizeBytes?: number | null;
242
+ source?: string | null;
243
+ hasPreview?: boolean;
244
+ }
245
+ interface AgenticAuthoringConversationContextContract {
246
+ sessionId?: string | null;
247
+ clientTurnId?: string | null;
248
+ conversationMessages?: AgenticAuthoringConversationMessageContract[];
249
+ pendingClarification?: AgenticAuthoringPendingClarificationContract | null;
250
+ attachmentSummaries?: AgenticAuthoringAttachmentSummaryContract[];
251
+ }
252
+ interface AgenticAuthoringIntentResolutionRequestContract extends AgenticAuthoringConversationContextContract {
253
+ userPrompt: string;
254
+ targetApp?: string | null;
255
+ targetComponentId?: string | null;
256
+ currentRoute?: string | null;
257
+ currentPage?: AiJsonObject | null;
258
+ selectedWidgetKey?: string | null;
259
+ provider?: string | null;
260
+ model?: string | null;
261
+ apiKey?: string | null;
262
+ contextHints?: AiContextHintsContract | null;
263
+ }
264
+ interface AgenticAuthoringCandidateContract {
265
+ resourcePath?: string | null;
266
+ operation?: string | null;
267
+ schemaUrl?: string | null;
268
+ submitUrl?: string | null;
269
+ submitMethod?: string | null;
270
+ score?: number | null;
271
+ reason?: string | null;
272
+ evidence?: string[] | null;
273
+ [key: string]: AiJsonValue | undefined;
274
+ }
275
+ interface AgenticAuthoringQuickReplyContract {
276
+ id: string;
277
+ kind: string;
278
+ label: string;
279
+ prompt: string;
280
+ description?: string | null;
281
+ icon?: string | null;
282
+ tone?: string | null;
283
+ contextHints?: AiContextHintsContract | null;
284
+ [key: string]: AiJsonValue | AiContextHintsContract | undefined;
285
+ }
286
+ interface AgenticAuthoringSemanticSelectedResourceContract {
287
+ resourcePath?: string | null;
288
+ operation?: string | null;
289
+ schemaUrl?: string | null;
290
+ submitUrl?: string | null;
291
+ submitMethod?: string | null;
292
+ [key: string]: AiJsonValue | undefined;
293
+ }
294
+ interface AgenticAuthoringSemanticRetrievalEvidenceContract {
295
+ retrievalSource?: string | null;
296
+ evidence?: string[];
297
+ candidateCount?: number;
298
+ [key: string]: AiJsonValue | undefined;
299
+ }
300
+ interface AgenticAuthoringEvidenceBundleEvidenceContract {
301
+ source?: string | null;
302
+ kind?: string | null;
303
+ ref?: string | null;
304
+ summary?: string | null;
305
+ confidence?: number | null;
306
+ matchedTerms?: string[];
307
+ tenantId?: string | null;
308
+ environment?: string | null;
309
+ releaseId?: string | null;
310
+ [key: string]: AiJsonValue | undefined;
311
+ }
312
+ interface AgenticAuthoringEvidenceBundleContract {
313
+ schemaVersion?: string | null;
314
+ retrievalSource?: string | null;
315
+ evidence?: AgenticAuthoringEvidenceBundleEvidenceContract[];
316
+ evidenceCount?: number;
317
+ [key: string]: AiJsonValue | AgenticAuthoringEvidenceBundleEvidenceContract[] | undefined;
318
+ }
319
+ interface AgenticAuthoringSemanticRefinementContract {
320
+ schemaVersion?: string | null;
321
+ refinementKind?: 'visual_projection' | 'data_source' | 'filtering' | 'layout' | 'metric' | 'copy' | 'governance' | string | null;
322
+ preserve?: string[];
323
+ replace?: Record<string, string>;
324
+ add?: Record<string, string[]>;
325
+ remove?: string[];
326
+ rationale?: string | null;
327
+ confidence?: number | null;
328
+ [key: string]: AiJsonValue | Record<string, string> | Record<string, string[]> | undefined;
329
+ }
330
+ interface AgenticAuthoringSemanticDecisionContract {
331
+ schemaVersion?: string | null;
332
+ decisionId?: string | null;
333
+ operationKind?: string | null;
334
+ artifactKind?: string | null;
335
+ changeKind?: string | null;
336
+ selectedResource?: AgenticAuthoringSemanticSelectedResourceContract | null;
337
+ visualizationDecision?: AgenticAuthoringVisualizationDecisionContract | null;
338
+ retrievalEvidence?: AgenticAuthoringSemanticRetrievalEvidenceContract | null;
339
+ retrievedEvidence?: AgenticAuthoringEvidenceBundleContract | null;
340
+ reviewRequired?: boolean | null;
341
+ reviewReason?: string | null;
342
+ previousDecisionRef?: string | null;
343
+ refinementOf?: string | null;
344
+ conversationId?: string | null;
345
+ turnId?: string | null;
346
+ userGoal?: string | null;
347
+ activeObjective?: string | null;
348
+ artifactIntent?: string | null;
349
+ visualIntent?: string | null;
350
+ constraints?: AiJsonObject | null;
351
+ refinement?: AgenticAuthoringSemanticRefinementContract | null;
352
+ previousDecisionId?: string | null;
353
+ rationale?: string | null;
354
+ confidence?: number | null;
355
+ [key: string]: AiJsonValue | AgenticAuthoringSemanticSelectedResourceContract | AgenticAuthoringSemanticRetrievalEvidenceContract | AgenticAuthoringEvidenceBundleContract | AgenticAuthoringSemanticRefinementContract | AgenticAuthoringVisualizationDecisionContract | undefined;
356
+ }
357
+ interface AgenticAuthoringIntentResolutionResultContract {
358
+ valid?: boolean;
359
+ operationKind?: string | null;
360
+ artifactKind?: string | null;
361
+ changeKind?: string | null;
362
+ selectedCandidate?: AgenticAuthoringCandidateContract | null;
363
+ candidates?: AgenticAuthoringCandidateContract[];
364
+ gate?: AiJsonObject | null;
365
+ effectivePrompt?: string | null;
366
+ assistantMessage?: string | null;
367
+ assistantContent?: AiJsonObject | null;
368
+ quickReplies?: AgenticAuthoringQuickReplyContract[];
369
+ pendingClarification?: AgenticAuthoringPendingClarificationContract | null;
370
+ clarificationQuestions?: string[];
371
+ warnings?: string[];
372
+ failureCodes?: string[];
373
+ llmDiagnostics?: AiJsonObject | null;
374
+ semanticDecision?: AgenticAuthoringSemanticDecisionContract | null;
375
+ visualizationDecision?: AgenticAuthoringVisualizationDecisionContract | null;
376
+ [key: string]: AiJsonValue | AgenticAuthoringCandidateContract | AgenticAuthoringCandidateContract[] | AgenticAuthoringQuickReplyContract | AgenticAuthoringQuickReplyContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringSemanticDecisionContract | AgenticAuthoringVisualizationDecisionContract | undefined;
377
+ }
378
+ interface AgenticAuthoringVisualizationAxisDecisionContract {
379
+ concept?: string | null;
380
+ field?: string | null;
381
+ label?: string | null;
382
+ chartType?: string | null;
383
+ orientation?: string | null;
384
+ metricAggregation?: string | null;
385
+ metricField?: string | null;
386
+ metricLabel?: string | null;
387
+ provenance?: string | null;
388
+ [key: string]: AiJsonValue | undefined;
389
+ }
390
+ interface AgenticAuthoringVisualizationDecisionContract {
391
+ schemaVersion?: string | null;
392
+ intent?: string | null;
393
+ layoutKind?: string | null;
394
+ primaryComponent?: string | null;
395
+ axes?: AgenticAuthoringVisualizationAxisDecisionContract[];
396
+ includeSummary?: boolean | null;
397
+ includeDetailTable?: boolean | null;
398
+ excludedComponentIds?: string[];
399
+ includeFilters?: boolean | null;
400
+ includeKpis?: boolean | null;
401
+ provenance?: string | null;
402
+ [key: string]: AiJsonValue | AgenticAuthoringVisualizationAxisDecisionContract[] | string[] | undefined;
403
+ }
404
+ interface AgenticAuthoringResourceCandidatesRequestContract {
405
+ retrievalQuery?: string | null;
406
+ userPrompt?: string | null;
407
+ artifactKind?: string | null;
408
+ limit?: number | null;
409
+ [key: string]: AiJsonValue | undefined;
410
+ }
411
+ interface AgenticAuthoringResourceCandidatesResultContract {
412
+ valid?: boolean;
413
+ tool?: string | null;
414
+ retrievalQuery?: string | null;
415
+ artifactKind?: string | null;
416
+ assistantMessage?: string | null;
417
+ assistantContent?: AiJsonObject | null;
418
+ candidates?: AgenticAuthoringCandidateContract[];
419
+ quickReplies?: AgenticAuthoringQuickReplyContract[];
420
+ warnings?: string[];
421
+ [key: string]: AiJsonValue | AgenticAuthoringCandidateContract[] | AgenticAuthoringQuickReplyContract[] | undefined;
422
+ }
423
+ interface AgenticAuthoringPlanRequestContract extends AgenticAuthoringConversationContextContract {
424
+ userPrompt: string;
425
+ provider?: string | null;
426
+ model?: string | null;
427
+ apiKey?: string | null;
428
+ currentPage?: AiJsonObject | null;
429
+ intentResolution?: AgenticAuthoringIntentResolutionResultContract | null;
430
+ contextHints?: AiContextHintsContract | null;
431
+ }
432
+ interface AgenticAuthoringTurnStreamRequestContract extends AgenticAuthoringConversationContextContract {
433
+ userPrompt: string;
434
+ targetApp?: string | null;
435
+ targetComponentId?: string | null;
436
+ currentRoute?: string | null;
437
+ currentPage?: AiJsonObject | null;
438
+ selectedWidgetKey?: string | null;
439
+ provider?: string | null;
440
+ model?: string | null;
441
+ apiKey?: string | null;
442
+ contextHints?: AiContextHintsContract | null;
443
+ componentCapabilities?: AgenticAuthoringComponentCapabilitiesResultContract | null;
444
+ activeSemanticDecision?: AgenticAuthoringSemanticDecisionContract | null;
445
+ [key: string]: AiJsonValue | AiContextHintsContract | AgenticAuthoringComponentCapabilitiesResultContract | AgenticAuthoringSemanticDecisionContract | AgenticAuthoringConversationMessageContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringAttachmentSummaryContract[] | undefined;
446
+ }
447
+ interface AgenticAuthoringPreviewResultContract {
448
+ valid?: boolean;
449
+ warnings?: string[];
450
+ minimalFormPlan?: AiJsonObject | null;
451
+ compiledFormPatch?: AiJsonObject | null;
452
+ uiCompositionPlan?: AiJsonObject | null;
453
+ diagnostics?: AiJsonObject | null;
454
+ [key: string]: AiJsonValue | undefined;
455
+ }
456
+ interface AgenticAuthoringApplyRequestContract {
457
+ componentType: string;
458
+ componentId: string;
459
+ scope?: string | null;
460
+ compiledFormPatch: AiJsonObject;
461
+ tags?: AiJsonObject | null;
462
+ semanticDecision: AgenticAuthoringSemanticDecisionContract;
463
+ [key: string]: AiJsonValue | AgenticAuthoringSemanticDecisionContract | undefined;
464
+ }
465
+ interface AgenticAuthoringApplyResultContract {
466
+ applied?: boolean;
467
+ etag?: string | null;
468
+ [key: string]: AiJsonValue | undefined;
469
+ }
470
+ interface AgenticAuthoringComponentFieldAliasContract {
471
+ field?: string | null;
472
+ aliases?: string[];
473
+ [key: string]: AiJsonValue | undefined;
474
+ }
475
+ interface AgenticAuthoringComponentCapabilityExampleContract {
476
+ prompt?: string | null;
477
+ intent?: string | null;
478
+ configHints?: string[];
479
+ [key: string]: AiJsonValue | undefined;
480
+ }
481
+ interface AgenticAuthoringComponentCapabilityContract {
482
+ id?: string | null;
483
+ changeKind?: string | null;
484
+ triggerTerms?: string[];
485
+ fieldAliases?: AgenticAuthoringComponentFieldAliasContract[];
486
+ examples?: AgenticAuthoringComponentCapabilityExampleContract[];
487
+ [key: string]: AiJsonValue | AgenticAuthoringComponentFieldAliasContract[] | AgenticAuthoringComponentCapabilityExampleContract[] | undefined;
488
+ }
489
+ interface AgenticAuthoringComponentCapabilityCatalogContract {
490
+ componentId?: string | null;
491
+ version?: string | null;
492
+ capabilities?: AgenticAuthoringComponentCapabilityContract[];
493
+ [key: string]: AiJsonValue | AgenticAuthoringComponentCapabilityContract[] | undefined;
494
+ }
495
+ interface AgenticAuthoringComponentCapabilitiesResultContract {
496
+ version?: string | null;
497
+ catalogs?: AgenticAuthoringComponentCapabilityCatalogContract[];
498
+ [key: string]: AiJsonValue | AgenticAuthoringComponentCapabilityCatalogContract[] | undefined;
499
+ }
500
+ interface AgenticAuthoringManifestEditPlanRequestContract {
501
+ config?: AiJsonObject | null;
502
+ plan?: AiJsonObject | null;
503
+ validationContext?: AiJsonObject | null;
504
+ }
505
+ interface AgenticAuthoringResolveTargetRequestContract {
506
+ config?: AiJsonObject | null;
507
+ operationId?: string | null;
508
+ target?: AiJsonValue;
509
+ input?: AiJsonValue;
510
+ }
511
+ interface AgenticAuthoringResolvedTargetContract {
512
+ status?: string | null;
513
+ componentId?: string | null;
514
+ operationId?: string | null;
515
+ kind?: string | null;
516
+ resolver?: string | null;
517
+ path?: string | null;
518
+ value?: AiJsonValue;
519
+ candidates?: string[];
520
+ failures?: string[];
521
+ }
522
+ interface AgenticAuthoringManifestValidationResultContract {
523
+ valid?: boolean;
524
+ failures?: string[];
525
+ warnings?: string[];
526
+ normalizedPlan?: AiJsonObject | null;
527
+ }
528
+ interface AgenticAuthoringManifestCompileResultContract {
529
+ compiled?: boolean;
530
+ failures?: string[];
531
+ warnings?: string[];
532
+ patch?: AiJsonObject | null;
533
+ }
534
+ interface AiPatchStreamStartResponseContract {
535
+ streamId: string;
536
+ threadId: string;
537
+ turnId: string;
538
+ eventSchemaVersion: string;
539
+ streamAuthMode?: 'cookie' | 'signed_url_token' | null;
540
+ streamAccessToken?: string | null;
541
+ observationId?: string | null;
542
+ expiresAt: string;
543
+ fallbackPatchUrl: string;
544
+ }
545
+ interface AgenticAuthoringTurnStreamStartResponseContract {
546
+ streamId: string;
547
+ threadId: string;
548
+ turnId: string;
549
+ eventSchemaVersion: string;
550
+ streamAuthMode?: 'cookie' | 'signed_url_token' | null;
551
+ streamAccessToken?: string | null;
552
+ observationId?: string | null;
553
+ expiresAt: string;
554
+ fallbackAuthoringUrl: string;
555
+ }
556
+ interface AiPatchStreamCancelResponseContract {
557
+ streamId?: string | null;
558
+ threadId?: string | null;
559
+ turnId?: string | null;
560
+ terminalState: 'cancelled' | 'completed' | 'not_found';
561
+ message?: string | null;
562
+ }
563
+ interface AiPatchStreamEnvelopeContract<TPayload extends AiJsonObject = AiJsonObject> {
564
+ eventId?: string | null;
565
+ streamId: string;
566
+ threadId: string;
567
+ turnId: string;
568
+ seq: number;
569
+ eventSchemaVersion: string;
570
+ timestamp: string;
571
+ type: AiPatchStreamEventType$1;
572
+ payload: TPayload;
573
+ }
574
+ interface AgenticAuthoringTurnStreamEnvelopeContract<TPayload extends AiJsonObject = AiJsonObject> extends AiPatchStreamEnvelopeContract<TPayload> {
575
+ }
576
+ interface ProblemResponseContract {
577
+ timestamp?: string | null;
578
+ status?: number | null;
579
+ error?: string | null;
580
+ message?: string | null;
581
+ path?: string | null;
582
+ detail?: string | null;
583
+ [key: string]: AiJsonValue | undefined;
584
+ }
585
+ type AiPatchStreamEventType$1 = (typeof AI_STREAM_EVENT_TYPES)[number];
586
+ type AiTurnStreamEventType = (typeof AI_STREAM_EVENT_TYPES)[number];
587
+
588
+ /**
589
+ * Models for Praxis AI (Centralized)
590
+ */
591
+
592
+ /**
593
+ * Response structure expected from the AI model
594
+ */
595
+ interface AiRuleResponse {
596
+ /** Descriptive name for the rule */
597
+ ruleName: string;
598
+ /** Type of target (scope) */
599
+ targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock';
600
+ /** IDs of the target elements */
601
+ targetIds: string[];
602
+ /** Canonical JSON Logic condition payload or null for always applied */
603
+ condition: AiJsonObject | null;
604
+ /** Effects to apply */
605
+ effects: {
606
+ /** Properties to apply when condition is true */
607
+ properties?: Record<string, any>;
608
+ /** Properties to apply when condition is false (else) */
609
+ propertiesWhenFalse?: Record<string, any>;
610
+ };
611
+ }
612
+ /**
613
+ * Minified field representation for AI context (token optimization)
614
+ */
615
+ interface MinifiedField {
616
+ id: string;
617
+ label: string;
618
+ type: string;
619
+ category?: string;
620
+ allowedValues?: Array<{
621
+ value: any;
622
+ label: string;
623
+ }>;
624
+ }
625
+ /**
626
+ * Context structure sent to the AI
627
+ */
628
+ interface PromptContext {
629
+ /** List of available fields formatted for the prompt */
630
+ fieldsText: string;
631
+ /** List of available properties for the selected target type */
632
+ propertiesText: string;
633
+ /** List of supported JSON Logic operators */
634
+ operatorsText: string;
635
+ /** Selected target type */
636
+ targetType: string;
637
+ /** Structured list of fields for richer prompt suggestions */
638
+ minifiedFields?: MinifiedField[];
639
+ }
640
+ /**
641
+ * Example pair for Few-Shot Learning
642
+ */
643
+ interface AiExamplePair {
644
+ userPrompt: string;
645
+ expectedResponse: AiRuleResponse;
646
+ }
647
+ /**
648
+ * Configuration for the AI Service
649
+ */
650
+ interface AiIntegrationConfig {
651
+ /** LLM provider (gemini/openai/xai/mock) */
652
+ provider?: string;
653
+ /** Gemini API Key (optional if using proxy/env) */
654
+ apiKey?: string;
655
+ /** Model version to use */
656
+ model: string;
657
+ /** Temperature (creativity vs determinism) */
658
+ temperature: number;
659
+ /** Max output tokens */
660
+ maxTokens: number;
661
+ /** Request timeout in ms */
662
+ timeout: number;
663
+ /** Number of retry attempts */
664
+ retryAttempts: number;
665
+ /** Optional: Backend gateway URL for Enterprise mode */
666
+ gatewayUrl?: string;
667
+ }
668
+ /**
669
+ * Result of validating an AI response
670
+ */
671
+ interface AiValidationResult {
672
+ valid: boolean;
673
+ errors: AiValidationError[];
674
+ warnings: AiValidationWarning[];
675
+ correctedResponse?: AiRuleResponse;
676
+ }
677
+ interface AiValidationError {
678
+ field: string;
679
+ message: string;
680
+ severity: 'critical' | 'error' | 'warning';
681
+ code: string;
682
+ }
683
+ interface AiValidationWarning {
684
+ field: string;
685
+ message: string;
686
+ suggestion?: string;
687
+ }
688
+ interface AiModel {
689
+ name: string;
690
+ version: string;
691
+ displayName: string;
692
+ description: string;
693
+ inputTokenLimit: number;
694
+ outputTokenLimit: number;
695
+ supportedGenerationMethods: string[];
696
+ temperature?: number;
697
+ topP?: number;
698
+ topK?: number;
699
+ }
700
+ type ValueKind = 'boolean' | 'string' | 'number' | 'enum' | 'expression' | 'object' | 'array';
701
+ interface Capability {
702
+ path: string;
703
+ category: string;
704
+ valueKind: ValueKind | string;
705
+ allowedValues?: Array<string | number>;
706
+ description?: string;
707
+ critical?: boolean;
708
+ intentExamples?: string[];
709
+ dependsOn?: string;
710
+ example?: string;
711
+ safetyNotes?: string;
712
+ }
713
+ type RulePropertyType = 'string' | 'boolean' | 'object' | 'enum' | 'number';
714
+ interface RulePropertyDefinition {
715
+ name: string;
716
+ type: RulePropertyType;
717
+ label: string;
718
+ description?: string;
719
+ enumValues?: Array<{
720
+ value: string;
721
+ label: string;
722
+ }>;
723
+ category?: 'content' | 'appearance' | 'behavior' | 'layout' | 'validation';
724
+ }
725
+ type RulePropertySchema = Record<'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', RulePropertyDefinition[]>;
726
+
727
+ type PraxisAssistantOwnerType = 'page-builder' | 'table' | 'dynamic-form' | 'manual-form' | 'list' | 'tabs' | 'stepper' | 'expansion' | 'app-shell' | 'custom';
728
+ type PraxisAssistantComponentType = 'page-builder' | 'table' | 'form' | 'list' | 'tabs' | 'stepper' | 'expansion' | 'widget' | 'custom';
729
+ type PraxisAssistantContextMode = 'config' | 'agentic-authoring' | 'chat' | 'diagnostic' | 'review' | 'inline-help';
730
+ type PraxisAssistantTargetKind = 'component' | 'field' | 'column' | 'row' | 'section' | 'widget' | 'canvas' | 'compositionLink' | 'action' | 'rule' | 'resource' | 'custom';
731
+ type PraxisAssistantAttachmentKind = 'file' | 'image' | 'json' | 'schema' | 'text' | 'url' | 'custom';
732
+ 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';
733
+ type PraxisAssistantRiskLevel = 'low' | 'medium' | 'high' | 'blocked';
734
+ interface PraxisAssistantIdentity {
735
+ sessionId: string;
736
+ ownerId: string;
737
+ ownerType: PraxisAssistantOwnerType | string;
738
+ componentId?: string;
739
+ componentType?: PraxisAssistantComponentType | string;
740
+ routeKey?: string;
741
+ tenantId?: string;
742
+ env?: string;
743
+ userId?: string;
744
+ }
745
+ interface PraxisAssistantTargetRef {
746
+ kind: PraxisAssistantTargetKind | string;
747
+ id: string;
748
+ label?: string;
749
+ path?: string;
750
+ schemaPath?: string;
751
+ metadata?: Readonly<Record<string, string | number | boolean>>;
752
+ }
753
+ interface PraxisAssistantContextItem {
754
+ id: string;
755
+ label: string;
756
+ value: string;
757
+ kind?: string;
758
+ tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
759
+ }
760
+ interface PraxisAssistantDigest {
761
+ label?: string;
762
+ summary?: string;
763
+ hash?: string;
764
+ source?: string;
765
+ fields?: readonly string[];
766
+ counts?: Readonly<Record<string, number>>;
767
+ }
768
+ interface PraxisAssistantAuthoringManifestRef {
769
+ componentId: string;
770
+ version?: string;
771
+ source?: string;
772
+ hash?: string;
773
+ }
774
+ interface PraxisAssistantCapabilityRef {
775
+ id: string;
776
+ label?: string;
777
+ source?: string;
778
+ risk?: PraxisAssistantRiskLevel;
779
+ }
780
+ interface PraxisAssistantGovernanceHint {
781
+ kind: string;
782
+ label?: string;
783
+ reason?: string;
784
+ target?: string;
785
+ risk?: PraxisAssistantRiskLevel;
786
+ }
787
+ interface PraxisAssistantAttachmentSummary {
788
+ id: string;
789
+ name: string;
790
+ kind: PraxisAssistantAttachmentKind | string;
791
+ mimeType?: string;
792
+ sizeBytes?: number;
793
+ source?: string;
794
+ hasPreview?: boolean;
795
+ }
796
+ interface PraxisAssistantActionContract {
797
+ id: string;
798
+ kind: PraxisAssistantActionKind | string;
799
+ label?: string;
800
+ target?: PraxisAssistantTargetRef;
801
+ capabilityRef?: string;
802
+ risk?: PraxisAssistantRiskLevel;
803
+ handoffEndpoint?: string;
804
+ description?: string;
805
+ }
806
+ interface PraxisAssistantContextSnapshot {
807
+ identity: PraxisAssistantIdentity;
808
+ target?: PraxisAssistantTargetRef;
809
+ contextItems: readonly PraxisAssistantContextItem[];
810
+ mode: PraxisAssistantContextMode;
811
+ authoringManifestRef?: PraxisAssistantAuthoringManifestRef;
812
+ resourcePath?: string;
813
+ schemaFields?: readonly string[];
814
+ dataProfileDigest?: PraxisAssistantDigest;
815
+ runtimeStateDigest?: PraxisAssistantDigest;
816
+ capabilityRefs?: readonly PraxisAssistantCapabilityRef[];
817
+ governanceHints?: readonly PraxisAssistantGovernanceHint[];
818
+ riskHints?: readonly PraxisAssistantGovernanceHint[];
819
+ attachmentSummaries?: readonly PraxisAssistantAttachmentSummary[];
820
+ actions?: readonly PraxisAssistantActionContract[];
821
+ }
822
+ interface PraxisAssistantOpenRequest {
823
+ initialPrompt?: string;
824
+ target?: PraxisAssistantTargetRef;
825
+ mode?: PraxisAssistantContextMode;
826
+ visibility?: 'active' | 'minimized';
827
+ contextHints?: Readonly<Record<string, string | number | boolean>>;
828
+ preferredAction?: PraxisAssistantActionContract;
829
+ selection?: PraxisAssistantTargetRef;
830
+ }
831
+ declare const PRAXIS_ASSISTANT_CONTEXT_TEXT_LIMIT = 160;
832
+ declare const PRAXIS_ASSISTANT_CONTEXT_ITEM_LIMIT = 12;
833
+ declare const PRAXIS_ASSISTANT_CONTEXT_SCHEMA_FIELD_LIMIT = 40;
834
+ declare const PRAXIS_ASSISTANT_CONTEXT_ATTACHMENT_LIMIT = 8;
835
+ declare function sanitizePraxisAssistantText(value: unknown, limit?: number): string;
836
+ declare function normalizePraxisAssistantAttachmentSummary(attachment: unknown): PraxisAssistantAttachmentSummary | null;
837
+ declare function normalizePraxisAssistantContextSnapshot(value: unknown): PraxisAssistantContextSnapshot;
838
+
839
+ type PraxisAssistantShellMessageRole = 'user' | 'assistant' | 'system' | 'status' | 'error';
840
+ type PraxisAssistantShellMode = 'config' | 'agentic-authoring' | 'chat' | 'diagnostic' | 'review' | 'inline-help';
841
+ type PraxisAssistantShellState = 'idle' | 'listening' | 'processing' | 'clarification' | 'review' | 'applying' | 'success' | 'error';
842
+ type PraxisAssistantVoiceInputMode = 'disabled' | 'browser-speech';
843
+ type PraxisAssistantVoiceCaptureState = 'unsupported' | 'idle' | 'listening' | 'stopping' | 'error';
844
+ interface PraxisAssistantShellMessage {
845
+ id: string;
846
+ role: PraxisAssistantShellMessageRole;
847
+ text: string;
848
+ status?: 'pending' | 'done' | 'error';
849
+ editable?: boolean;
850
+ resendable?: boolean;
851
+ observationId?: string | null;
852
+ actions?: readonly PraxisAssistantShellMessageAction[];
853
+ }
854
+ interface PraxisAssistantShellQuickReply {
855
+ id: string;
856
+ label: string;
857
+ prompt: string;
858
+ value?: unknown;
859
+ kind?: string;
860
+ description?: string | null;
861
+ icon?: string | null;
862
+ tone?: string | null;
863
+ presentation?: PraxisAssistantShellQuickReplyPresentation | null;
864
+ contextHints?: Readonly<Record<string, unknown>> | null;
865
+ canonicalAction?: Readonly<Record<string, unknown>> | null;
866
+ semanticDecision?: Readonly<Record<string, unknown>> | null;
867
+ }
868
+ type PraxisAssistantShellQuickReplyPresentationKind = 'resource-candidate' | 'contextual-action' | 'governance-confirmation' | 'guided-option' | string;
869
+ interface PraxisAssistantShellQuickReplyPresentation {
870
+ kind?: PraxisAssistantShellQuickReplyPresentationKind | null;
871
+ categoryLabel?: string | null;
872
+ description?: string | null;
873
+ ctaLabel?: string | null;
874
+ icon?: string | null;
875
+ tone?: string | null;
876
+ technicalDetails?: string | null;
877
+ evidence?: readonly PraxisAssistantShellQuickReplyEvidence[];
878
+ items?: readonly PraxisAssistantShellQuickReplyPresentationItem[];
879
+ }
880
+ interface PraxisAssistantShellQuickReplyEvidence {
881
+ icon?: string | null;
882
+ value: string;
883
+ ariaLabel?: string | null;
884
+ }
885
+ interface PraxisAssistantShellQuickReplyPresentationItem {
886
+ key?: 'bestFor' | 'returns' | 'nextStep' | string;
887
+ label: string;
888
+ value: string;
889
+ icon?: string | null;
890
+ }
891
+ type PraxisAssistantOpportunityCandidateStatus = 'available' | 'missing-context' | 'already-enabled' | 'blocked' | 'not-recommended' | string;
892
+ type PraxisAssistantRecommendedIntentTone = 'neutral' | 'analytics' | 'resource' | 'success' | 'warning' | 'danger' | string;
893
+ interface PraxisAssistantOpportunityGroup {
894
+ id: string;
895
+ label: string;
896
+ description?: string | null;
897
+ rank?: number | null;
898
+ }
899
+ interface PraxisAssistantRecommendedIntentPresentation {
900
+ kind?: 'guided-card' | 'compact-chip' | 'spotlight' | string;
901
+ description?: string | null;
902
+ ctaLabel?: string | null;
903
+ icon?: string | null;
904
+ tone?: PraxisAssistantRecommendedIntentTone | null;
905
+ evidence?: readonly PraxisAssistantShellQuickReplyEvidence[];
906
+ items?: readonly PraxisAssistantShellQuickReplyPresentationItem[];
907
+ }
908
+ type PraxisAssistantRecommendedIntentAction = {
909
+ kind: 'submit-prompt';
910
+ prompt: string;
911
+ contextHints?: Readonly<Record<string, unknown>> | null;
912
+ } | {
913
+ kind: 'start-review';
914
+ operationKind: 'author' | 'execute' | string;
915
+ componentEditPlan?: Readonly<Record<string, unknown>> | null;
916
+ runtimeOperation?: Readonly<Record<string, unknown>> | null;
917
+ contextHints?: Readonly<Record<string, unknown>> | null;
918
+ } | {
919
+ kind: 'open-guidance';
920
+ topicId: string;
921
+ contextHints?: Readonly<Record<string, unknown>> | null;
922
+ } | {
923
+ kind: string;
924
+ [key: string]: unknown;
925
+ };
926
+ interface PraxisAssistantRecommendedIntent {
927
+ kind?: 'praxis.assistant.recommended-intent' | string;
928
+ id: string;
929
+ label: string;
930
+ description?: string | null;
931
+ group?: PraxisAssistantOpportunityGroup | null;
932
+ icon?: string | null;
933
+ tone?: PraxisAssistantRecommendedIntentTone | null;
934
+ presentation?: PraxisAssistantRecommendedIntentPresentation | null;
935
+ action: PraxisAssistantRecommendedIntentAction;
936
+ prompt?: string | null;
937
+ contextHints?: Readonly<Record<string, unknown>> | null;
938
+ sourceCandidateIds?: readonly string[];
939
+ rank?: number | null;
940
+ confidence?: number | null;
941
+ requiresConfirmation?: boolean;
942
+ disabledReason?: string | null;
943
+ }
944
+ interface PraxisAssistantOpportunityEvidence {
945
+ kind: 'component-state' | 'metadata' | 'selection' | 'capability' | 'usage' | 'host' | string;
946
+ label?: string | null;
947
+ value?: string | number | boolean | null;
948
+ details?: Readonly<Record<string, unknown>> | null;
949
+ }
950
+ interface PraxisAssistantOpportunityTarget {
951
+ kind: 'component' | 'field' | 'record-surface' | 'action' | 'navigation' | 'export' | string;
952
+ id: string;
953
+ label?: string | null;
954
+ componentId?: string | null;
955
+ field?: string | null;
956
+ surfaceId?: string | null;
957
+ capabilityId?: string | null;
958
+ metadata?: Readonly<Record<string, unknown>> | null;
959
+ }
960
+ interface PraxisAssistantOpportunityMissingContext {
961
+ id: string;
962
+ label: string;
963
+ reason?: string | null;
964
+ required?: boolean;
965
+ }
966
+ interface PraxisAssistantOpportunitySafety {
967
+ requiresConfirmation?: boolean;
968
+ destructive?: boolean;
969
+ reason?: string | null;
970
+ }
971
+ interface PraxisAssistantOpportunityCandidate {
972
+ id: string;
973
+ label: string;
974
+ description?: string | null;
975
+ group?: PraxisAssistantOpportunityGroup | null;
976
+ target: PraxisAssistantOpportunityTarget;
977
+ status?: PraxisAssistantOpportunityCandidateStatus;
978
+ rank?: number | null;
979
+ confidence?: number | null;
980
+ evidence?: readonly PraxisAssistantOpportunityEvidence[];
981
+ missingContext?: readonly PraxisAssistantOpportunityMissingContext[];
982
+ safety?: PraxisAssistantOpportunitySafety | null;
983
+ recommendedIntent?: PraxisAssistantRecommendedIntent | null;
984
+ metadata?: Readonly<Record<string, unknown>> | null;
985
+ }
986
+ interface PraxisAssistantOpportunityCatalog {
987
+ componentId: string;
988
+ componentKind?: string | null;
989
+ generatedAt?: string | null;
990
+ stateHash?: string | null;
991
+ candidates: readonly PraxisAssistantOpportunityCandidate[];
992
+ groups?: readonly PraxisAssistantOpportunityGroup[];
993
+ metadata?: Readonly<Record<string, unknown>> | null;
994
+ }
995
+ interface PraxisAssistantShellMessageAction {
996
+ id: string;
997
+ label: string;
998
+ kind?: 'edit' | 'resend' | 'copy' | 'custom' | string;
999
+ icon?: string | null;
1000
+ ariaLabel?: string | null;
1001
+ iconOnly?: boolean;
1002
+ disabled?: boolean;
1003
+ }
1004
+ type PraxisAssistantShellActionTone = 'primary' | 'secondary' | 'governance' | 'success' | 'warning' | 'danger' | 'neutral' | string;
1005
+ interface PraxisAssistantShellAction {
1006
+ id: string;
1007
+ label: string;
1008
+ kind?: 'submit-prompt' | 'apply' | 'retry' | 'cancel' | 'simulate' | 'review' | 'publish' | 'materialize' | 'correct' | 'custom' | string;
1009
+ icon?: string | null;
1010
+ tone?: PraxisAssistantShellActionTone | null;
1011
+ disabled?: boolean;
1012
+ requiresPrompt?: boolean;
1013
+ testId?: string | null;
1014
+ ariaLabel?: string | null;
1015
+ iconOnly?: boolean;
1016
+ }
1017
+ interface PraxisAssistantShellContextItem {
1018
+ id: string;
1019
+ label: string;
1020
+ value?: string;
1021
+ kind?: 'component' | 'schema' | 'selection' | 'route' | 'tenant' | 'mode' | 'custom' | string;
1022
+ icon?: string;
1023
+ }
1024
+ interface PraxisAssistantShellAttachment {
1025
+ id: string;
1026
+ name: string;
1027
+ kind: 'image' | 'file' | 'json' | 'schema' | 'text' | string;
1028
+ mimeType?: string;
1029
+ sizeBytes?: number;
1030
+ file?: File;
1031
+ previewUrl?: string;
1032
+ source?: 'paste' | 'file-picker' | 'host' | string;
1033
+ status?: 'ready' | 'uploading' | 'error';
1034
+ error?: string;
1035
+ }
1036
+ interface PraxisAssistantShellLayout {
1037
+ left: number;
1038
+ top: number;
1039
+ width: number;
1040
+ height: number;
1041
+ }
1042
+ interface PraxisAssistantViewportLayoutOptions {
1043
+ width?: number;
1044
+ height?: number;
1045
+ top?: number;
1046
+ margin?: number;
1047
+ }
1048
+ declare function createPraxisAssistantViewportLayout(options?: PraxisAssistantViewportLayoutOptions): PraxisAssistantShellLayout;
1049
+ interface PraxisAssistantShellLabels {
1050
+ title: string;
1051
+ subtitle?: string;
1052
+ close: string;
1053
+ prompt: string;
1054
+ promptPlaceholder: string;
1055
+ emptyConversation: string;
1056
+ submit: string;
1057
+ apply: string;
1058
+ conversationAria: string;
1059
+ quickRepliesAria: string;
1060
+ quickReplyDetails?: string;
1061
+ recommendedIntentsAria: string;
1062
+ recommendedIntentsTitle: string;
1063
+ recommendedIntentCta: string;
1064
+ recommendedIntentGuidanceCta: string;
1065
+ recommendedIntentRequiresConfirmation: string;
1066
+ dragHandleAria: string;
1067
+ resizeHandleAria: string;
1068
+ resetLayout?: string;
1069
+ contextAria: string;
1070
+ attachmentsAria: string;
1071
+ attach: string;
1072
+ removeAttachment: string;
1073
+ editMessage: string;
1074
+ resendMessage: string;
1075
+ feedbackPositive: string;
1076
+ feedbackNegative: string;
1077
+ feedbackSubmitted: string;
1078
+ voiceStart?: string;
1079
+ voiceStop?: string;
1080
+ voiceListening?: string;
1081
+ voiceUnsupported?: string;
1082
+ voicePermissionDenied?: string;
1083
+ voiceNoSpeech?: string;
1084
+ modeConfig: string;
1085
+ modeAgenticAuthoring: string;
1086
+ modeChat: string;
1087
+ modeDiagnostic: string;
1088
+ modeReview: string;
1089
+ modeInlineHelp: string;
1090
+ stateIdle: string;
1091
+ stateListening: string;
1092
+ stateProcessing: string;
1093
+ stateClarification: string;
1094
+ stateReview: string;
1095
+ stateApplying: string;
1096
+ stateSuccess: string;
1097
+ stateError: string;
1098
+ }
1099
+
1100
+ type PraxisAssistantTurnPhase = 'capture' | 'contextualize' | 'clarify' | 'plan' | 'preview' | 'review' | 'apply' | 'summarize';
1101
+ type PraxisAssistantClarificationQuestionType = 'text' | 'single-choice' | 'multi-choice' | 'confirm' | 'resource' | 'field' | 'schema' | 'date-range' | 'number' | 'color' | 'component';
1102
+ interface PraxisAssistantClarificationOption {
1103
+ id: string;
1104
+ label: string;
1105
+ value: string;
1106
+ description?: string;
1107
+ displayPrompt?: string;
1108
+ example?: string;
1109
+ contextHints?: Record<string, unknown>;
1110
+ canonicalAction?: Record<string, unknown>;
1111
+ semanticDecision?: Record<string, unknown>;
1112
+ }
1113
+ interface PraxisAssistantClarificationQuestion {
1114
+ id: string;
1115
+ type: PraxisAssistantClarificationQuestionType;
1116
+ label: string;
1117
+ description?: string;
1118
+ required?: boolean;
1119
+ allowCustom?: boolean;
1120
+ options?: readonly PraxisAssistantClarificationOption[];
1121
+ }
1122
+ interface PraxisAssistantTurnAction {
1123
+ kind: 'submit' | 'clarify' | 'apply' | 'cancel' | 'retry' | 'edit-message' | 'resend-message' | 'attach' | 'remove-attachment' | string;
1124
+ id?: string;
1125
+ value?: unknown;
1126
+ displayPrompt?: string;
1127
+ contextHints?: Record<string, unknown>;
1128
+ }
1129
+ interface PraxisAssistantPendingClarification {
1130
+ sourcePrompt: string;
1131
+ questions: readonly PraxisAssistantClarificationQuestion[];
1132
+ assistantMessage?: string;
1133
+ clientTurnId?: string;
1134
+ diagnostics?: Record<string, unknown>;
1135
+ observationId?: string | null;
1136
+ }
1137
+ type PraxisAssistantConversationMessageRole = 'user' | 'assistant' | 'system';
1138
+ interface PraxisAssistantConversationMessage {
1139
+ id: string;
1140
+ role: PraxisAssistantConversationMessageRole;
1141
+ text: string;
1142
+ }
1143
+ declare function toPraxisAssistantConversationMessages(messages: readonly PraxisAssistantShellMessage[], limit?: number): PraxisAssistantConversationMessage[];
1144
+ interface PraxisAssistantTurnRequest {
1145
+ mode: PraxisAssistantShellMode;
1146
+ phase?: PraxisAssistantTurnPhase;
1147
+ prompt?: string;
1148
+ action?: PraxisAssistantTurnAction;
1149
+ sessionId?: string;
1150
+ clientTurnId?: string;
1151
+ componentId?: string;
1152
+ componentType?: string;
1153
+ messages?: readonly PraxisAssistantShellMessage[];
1154
+ contextItems?: readonly PraxisAssistantShellContextItem[];
1155
+ attachments?: readonly PraxisAssistantShellAttachment[];
1156
+ currentState?: unknown;
1157
+ runtimeState?: unknown;
1158
+ schemaFields?: unknown;
1159
+ dataProfile?: unknown;
1160
+ contextHints?: Record<string, unknown>;
1161
+ preview?: unknown;
1162
+ pendingPatch?: unknown;
1163
+ pendingClarification?: PraxisAssistantPendingClarification;
1164
+ diagnostics?: Record<string, unknown>;
1165
+ observationId?: string | null;
1166
+ }
1167
+ interface PraxisAssistantTurnResult {
1168
+ state: PraxisAssistantShellState;
1169
+ phase?: PraxisAssistantTurnPhase;
1170
+ assistantMessage?: string;
1171
+ messages?: readonly PraxisAssistantShellMessage[];
1172
+ quickReplies?: readonly PraxisAssistantShellQuickReply[];
1173
+ clarificationQuestions?: readonly PraxisAssistantClarificationQuestion[];
1174
+ contextItems?: readonly PraxisAssistantShellContextItem[];
1175
+ attachments?: readonly PraxisAssistantShellAttachment[];
1176
+ canApply?: boolean;
1177
+ statusText?: string;
1178
+ errorText?: string;
1179
+ preview?: unknown;
1180
+ pendingPatch?: unknown;
1181
+ pendingClarification?: PraxisAssistantPendingClarification | null;
1182
+ sessionId?: string;
1183
+ clientTurnId?: string;
1184
+ diagnostics?: Record<string, unknown>;
1185
+ observationId?: string | null;
1186
+ }
1187
+ interface PraxisAssistantTurnViewState {
1188
+ mode: PraxisAssistantShellMode;
1189
+ state: PraxisAssistantShellState;
1190
+ phase: PraxisAssistantTurnPhase;
1191
+ sessionId?: string;
1192
+ clientTurnId?: string;
1193
+ messages: PraxisAssistantShellMessage[];
1194
+ quickReplies: PraxisAssistantShellQuickReply[];
1195
+ clarificationQuestions: PraxisAssistantClarificationQuestion[];
1196
+ contextItems: PraxisAssistantShellContextItem[];
1197
+ attachments: PraxisAssistantShellAttachment[];
1198
+ canApply: boolean;
1199
+ statusText: string;
1200
+ errorText: string;
1201
+ preview?: unknown;
1202
+ pendingPatch?: unknown;
1203
+ pendingClarification?: PraxisAssistantPendingClarification;
1204
+ diagnostics?: Record<string, unknown>;
1205
+ observationId?: string | null;
1206
+ }
1207
+ interface PraxisAssistantTurnFlow {
1208
+ readonly mode: PraxisAssistantShellMode;
1209
+ submit(request: PraxisAssistantTurnRequest): Promise<PraxisAssistantTurnResult> | rxjs.Observable<PraxisAssistantTurnResult>;
1210
+ apply?(request: PraxisAssistantTurnRequest): Promise<PraxisAssistantTurnResult> | rxjs.Observable<PraxisAssistantTurnResult>;
1211
+ cancel?(request: PraxisAssistantTurnRequest): Promise<PraxisAssistantTurnResult> | rxjs.Observable<PraxisAssistantTurnResult>;
1212
+ retry?(request: PraxisAssistantTurnRequest): Promise<PraxisAssistantTurnResult> | rxjs.Observable<PraxisAssistantTurnResult>;
1213
+ }
1214
+
1215
+ interface PatchResult {
1216
+ success: boolean;
1217
+ warnings?: string[];
1218
+ error?: string;
1219
+ }
1220
+ interface AiSuggestion {
1221
+ id: string;
1222
+ label: string;
1223
+ description?: string;
1224
+ icon?: string;
1225
+ group?: string;
1226
+ intent: string;
1227
+ score?: number;
1228
+ variantId?: string;
1229
+ patch?: Record<string, unknown> | null;
1230
+ contextHints?: Record<string, unknown> | null;
1231
+ missingContext?: string[];
1232
+ }
1233
+ interface AiResponseCompileResult {
1234
+ patch?: AiJsonObject;
1235
+ explanation?: string;
1236
+ type?: 'error';
1237
+ message?: string;
1238
+ warnings?: string[];
1239
+ }
1240
+ type AiAuthoringResponseModeKind = 'consult' | 'edit' | string;
1241
+ interface AiAuthoringResponseMode {
1242
+ kind: AiAuthoringResponseModeKind;
1243
+ operationKind?: 'consult' | 'author' | 'edit' | string;
1244
+ changeKind?: 'answer' | string;
1245
+ preferredResponse?: string;
1246
+ useWhen?: string[];
1247
+ rules?: string[];
1248
+ }
1249
+ interface AiConsultativeAuthoringContext {
1250
+ [key: string]: unknown;
1251
+ resourcePath?: string | null;
1252
+ answerableQuestionKinds?: string[];
1253
+ }
1254
+ interface AiComponentAuthoringContract {
1255
+ [key: string]: unknown;
1256
+ kind: 'praxis.component-authoring-context' | string;
1257
+ componentId?: string;
1258
+ componentType?: string;
1259
+ preferredResponse?: string;
1260
+ responseModes?: AiAuthoringResponseMode[];
1261
+ consultativeContext?: AiConsultativeAuthoringContext;
1262
+ }
1263
+ declare function createComponentAuthoringContext(authoringContract: AiComponentAuthoringContract): AiJsonObject;
1264
+ declare function toAiJsonObject(value: unknown, path?: string): AiJsonObject;
1265
+ /**
1266
+ * Contrato fundamental para qualquer componente que suporte configuração via IA.
1267
+ * O Agente de IA usa esta interface para Ler (Introspecção) e Escrever (Patching) no componente.
1268
+ */
1269
+ interface AiConfigAdapter<TConfig = any> {
1270
+ /**
1271
+ * Nome legível do componente para o contexto do prompt (ex: "Data Table").
1272
+ */
1273
+ componentName: string;
1274
+ /**
1275
+ * ID do componente (selector) usado pelo backend AI registry (ex: "praxis-table").
1276
+ */
1277
+ componentId?: string;
1278
+ /**
1279
+ * Tipo lógico do componente para contexto (ex: "table", "form").
1280
+ */
1281
+ componentType?: string;
1282
+ /**
1283
+ * Retorna o objeto de configuração serializável atual.
1284
+ * Usado para que a IA entenda o estado inicial.
1285
+ */
1286
+ getCurrentConfig(): TConfig;
1287
+ /**
1288
+ * Retorna o catálogo de capacidades (o que a IA pode mudar).
1289
+ * Deve ser o conteúdo do arquivo `_ai-capabilities.ts`.
1290
+ */
1291
+ getCapabilities(): Capability[];
1292
+ /**
1293
+ * Retorna exemplos de intenção ou presets de tarefas suportados.
1294
+ * Útil para filtrar capabilities no prompt.
1295
+ * @deprecated Use getSuggestions() for richer context.
1296
+ */
1297
+ getTaskPresets?(): Record<string, string[]>;
1298
+ /**
1299
+ * Retorna sugestões contextuais baseadas na config atual e dados (Heurísticas).
1300
+ * Substitui ou complementa os presets estáticos.
1301
+ */
1302
+ getSuggestions?(forceReload?: boolean): Promise<AiSuggestion[]>;
1303
+ /**
1304
+ * Retorna contexto adicional para geração de sugestões (ex.: recursos disponíveis).
1305
+ */
1306
+ getSuggestionContext?(): Record<string, any>;
1307
+ /**
1308
+ * Retorna o perfil de dados atual (ex.: estatísticas por coluna).
1309
+ * Usado para sugestões determinísticas no backend.
1310
+ */
1311
+ getDataProfile?(): Record<string, any>;
1312
+ /**
1313
+ * Retorna hints de schema por campo (ex.: controlType, numericFormat).
1314
+ * Usado para sugestões heurísticas mais precisas no backend.
1315
+ */
1316
+ getSchemaFields?(): Record<string, any>[];
1317
+ /**
1318
+ * Prepara contexto assíncrono necessário antes de montar snapshots para IA.
1319
+ * Ex.: uma tabela pode carregar o schema canônico de filtros antes de expor
1320
+ * o contrato de authoring ao backend.
1321
+ */
1322
+ prepareAuthoringContext?(): Promise<void> | void;
1323
+ /**
1324
+ * Retorna contexto declarativo adicional para authoring assistido por IA.
1325
+ * Deve conter contratos validaveis e instrucoes especificas do componente
1326
+ * que o backend pode incluir em contextHints sem conhecer a lib concreta.
1327
+ */
1328
+ getAuthoringContext?(): AiJsonObject | null | undefined;
1329
+ /**
1330
+ * Retorna um snapshot do estado de tempo de execução (volátil).
1331
+ * Ex: { rowCount: 50, isLoading: false, sort: 'name:asc' }.
1332
+ * Usado para responder perguntas do usuário ("Por que está vazio?").
1333
+ */
1334
+ getRuntimeState?(): Record<string, any>;
1335
+ /**
1336
+ * Compila respostas declarativas especificas do componente em patch canonico.
1337
+ * Ex.: uma tabela pode transformar "componentEditPlan" em alteracoes validadas de colunas.
1338
+ * Retorne null/undefined quando a resposta ja estiver no contrato comum do assistente.
1339
+ */
1340
+ compileAiResponse?(response: Record<string, unknown>): AiResponseCompileResult | null | undefined;
1341
+ /**
1342
+ * Cria um snapshot do estado atual para fins de Undo.
1343
+ * Retorna um token opaco (pode ser o config JSON completo ou um ID).
1344
+ */
1345
+ createSnapshot(): any;
1346
+ /**
1347
+ * Restaura o estado para um snapshot anterior.
1348
+ */
1349
+ restoreSnapshot(snapshot: any): Promise<void>;
1350
+ /**
1351
+ * Aplica um patch de configuração gerado pela IA.
1352
+ * O Adapter deve validar, mesclar e garantir a reatividade do componente.
1353
+ *
1354
+ * @param patch O JSON parcial gerado pela IA.
1355
+ * @param intent A intenção original do usuário (para logs ou decisões heurísticas).
1356
+ */
1357
+ applyPatch(patch: Partial<TConfig>, intent?: string): Promise<PatchResult>;
1358
+ }
1359
+
1360
+ /**
1361
+ * Base implementation for AI Adapters.
1362
+ * Provides common validation logic against the Capabilities Catalog.
1363
+ */
1364
+ declare abstract class BaseAiAdapter<TConfig = any> implements AiConfigAdapter<TConfig> {
1365
+ abstract componentName: string;
1366
+ abstract getCurrentConfig(): TConfig;
1367
+ abstract getCapabilities(): Capability[];
1368
+ abstract applyPatch(patch: Partial<TConfig>, intent?: string): Promise<PatchResult>;
1369
+ abstract createSnapshot(): any;
1370
+ abstract restoreSnapshot(snapshot: any): Promise<void>;
1371
+ getTaskPresets?(): Record<string, string[]>;
1372
+ getSuggestions(_forceReload?: boolean): Promise<AiSuggestion[]>;
1373
+ getSuggestionContext?(): Record<string, any>;
1374
+ getRuntimeState?(): Record<string, any>;
1375
+ getAuthoringContext?(): Record<string, any> | null;
1376
+ compileAiResponse?(_response: Record<string, unknown>): AiResponseCompileResult | null;
1377
+ /**
1378
+ * Helper to validate a patch against the capabilities catalog.
1379
+ * Removes keys that are not in the allowed paths.
1380
+ */
1381
+ protected validatePatchAgainstCapabilities(patch: any): any;
1382
+ /**
1383
+ * Helper to check if a patch contains critical changes.
1384
+ */
1385
+ protected getCriticalWarnings(patch: any): string[];
1386
+ }
1387
+
1388
+ interface AiGovernedDecisionRoutingOptions {
1389
+ localCompositionTerms?: readonly string[];
1390
+ }
1391
+ /**
1392
+ * @deprecated Component assistants must not infer governed authoring from user
1393
+ * wording. Route through the backend semantic resolver and use this only for
1394
+ * explicit, structured context provided by a canonical backend source.
1395
+ */
1396
+ declare function shouldRoutePromptToGovernedDecision(prompt: string, contextHints?: AiJsonObject, options?: AiGovernedDecisionRoutingOptions): boolean;
1397
+ declare function normalizeAuthoringPrompt(prompt: string): string;
1398
+
1399
+ interface FieldSchemaLike {
1400
+ label: string;
1401
+ type: string;
1402
+ description?: string;
1403
+ required?: boolean;
1404
+ uiConfig?: {
1405
+ category?: string;
1406
+ };
1407
+ allowedValues?: Array<{
1408
+ value: any;
1409
+ label: string;
1410
+ }>;
1411
+ }
1412
+ declare class SchemaMinifierService {
1413
+ /**
1414
+ * Converts complete FieldSchemas into a minified version for AI context (Token optimized)
1415
+ */
1416
+ minify(schemas: Record<string, FieldSchemaLike>): MinifiedField[];
1417
+ /**
1418
+ * Formats minified fields into a string for the AI prompt (Legacy/Text mode)
1419
+ */
1420
+ toPromptFormat(fields: MinifiedField[]): string;
1421
+ /**
1422
+ * Transforms Praxis FieldSchemas into Google Gemini JSON Schema format.
1423
+ * This enables "Response Schema" enforcement in the API.
1424
+ */
1425
+ toGeminiSchema(fields: Record<string, FieldSchemaLike>): Schema;
1426
+ private mapTypeToGemini;
1427
+ static ɵfac: i0.ɵɵFactoryDeclaration<SchemaMinifierService, never>;
1428
+ static ɵprov: i0.ɵɵInjectableDeclaration<SchemaMinifierService>;
1429
+ }
1430
+
1431
+ interface PraxisAiConfigSource {
1432
+ getAiConfigSnapshot?: () => Partial<AiIntegrationConfig> | null | undefined;
1433
+ aiConfigChanges$?: Observable<Partial<AiIntegrationConfig> | null>;
1434
+ }
1435
+ declare class PraxisAiService {
1436
+ private readonly configSource;
1437
+ private genAI;
1438
+ private config;
1439
+ constructor(configSource: PraxisAiConfigSource | null);
1440
+ private syncConfig;
1441
+ classifyIntent(userInput: string, columns: string[]): Observable<any>;
1442
+ answerQuestion(userInput: string, targetConfig: any): Observable<string>;
1443
+ executeEnrichedPrompt(userInput: string, contextDescription: string, targetConfig: any, capabilities: any): Observable<any>;
1444
+ private formatCapabilities;
1445
+ generateContent(prompt: string, modelName?: string): Observable<string>;
1446
+ generateContentStream(prompt: string, modelName?: string): Observable<string>;
1447
+ generateJson<T>(prompt: string, modelName?: string, schema?: any): Observable<T | null>;
1448
+ isMockMode(): boolean;
1449
+ listModels(apiKey?: string): Observable<AiModel[]>;
1450
+ testConnection(apiKey?: string, model?: string): Observable<boolean>;
1451
+ private resolveProvider;
1452
+ private isGeminiProvider;
1453
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiService, [{ optional: true; }]>;
1454
+ static ɵprov: i0.ɵɵInjectableDeclaration<PraxisAiService>;
1455
+ }
1456
+
1457
+ declare const AI_INTENT_CONTRACT_VERSION: "v1.1";
1458
+ declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "41767dafdf6ebea802c083d77187ad6612937d6831188938dc21adce384b57a2";
1459
+ type AiSchemaContext = AiSchemaContextContract;
1460
+ interface AiSuggestionsRequest {
1461
+ componentId: string;
1462
+ componentType: string;
1463
+ currentState: AiJsonObject;
1464
+ dataProfile?: AiJsonObject | null;
1465
+ variantId?: string;
1466
+ maxSuggestions?: number;
1467
+ forceRefresh?: boolean;
1468
+ locale?: string;
1469
+ }
1470
+ interface AiSuggestionsResponse {
1471
+ suggestions: AiSuggestion[];
1472
+ source?: string;
1473
+ cacheKey?: string;
1474
+ cacheHit?: boolean;
1475
+ warnings?: string[];
1476
+ }
1477
+ type AiOrchestratorRequest = AiOrchestratorRequestContract;
1478
+ type AiChatMessage = AiChatMessageContract;
1479
+ type AiUiContextRef = AiUiContextRefContract;
1480
+ type AiCurrentStateDigest = AiCurrentStateDigestContract;
1481
+ type AiPatchDiff = AiPatchDiffContract;
1482
+ type AiOrchestratorResponse = AiOrchestratorResponseContract & {
1483
+ riskLevel?: string;
1484
+ requiresConfirmation?: boolean;
1485
+ questions?: string[];
1486
+ };
1487
+ type AiPatchStreamEventType = AiPatchStreamEventType$1;
1488
+ type AiPatchStreamStartResponse = AiPatchStreamStartResponseContract;
1489
+ type AiPatchStreamCancelResponse = AiPatchStreamCancelResponseContract;
1490
+ type AiPatchStreamEnvelope<TPayload extends AiJsonObject = AiJsonObject> = AiPatchStreamEnvelopeContract<TPayload>;
1491
+ type AgenticAuthoringManifestEditPlanRequest = AgenticAuthoringManifestEditPlanRequestContract;
1492
+ type AgenticAuthoringResolveTargetRequest = AgenticAuthoringResolveTargetRequestContract;
1493
+ type AgenticAuthoringResolvedTarget = AgenticAuthoringResolvedTargetContract;
1494
+ type AgenticAuthoringManifestValidationResult = AgenticAuthoringManifestValidationResultContract;
1495
+ type AgenticAuthoringManifestCompileResult = AgenticAuthoringManifestCompileResultContract;
1496
+ type AgenticAuthoringTurnStreamRequest = AgenticAuthoringTurnStreamRequestContract;
1497
+ type AgenticAuthoringTurnStreamStartResponse = AgenticAuthoringTurnStreamStartResponseContract;
1498
+ type AgenticAuthoringTurnStreamEnvelope<TPayload extends AiJsonObject = AiJsonObject> = AgenticAuthoringTurnStreamEnvelopeContract<TPayload>;
1499
+ interface AiPatchStreamConnection {
1500
+ events$: Observable<AiPatchStreamEnvelope>;
1501
+ close: () => void;
1502
+ }
1503
+ interface AgenticAuthoringTurnStreamConnection {
1504
+ events$: Observable<AgenticAuthoringTurnStreamEnvelope>;
1505
+ close: () => void;
1506
+ }
1507
+ type AiPatchStreamConnectionErrorKind = 'unsupported' | 'http_status' | 'transport' | 'parse' | 'schema';
1508
+ declare class AiPatchStreamConnectionError extends Error {
1509
+ readonly kind: AiPatchStreamConnectionErrorKind;
1510
+ readonly status?: number | undefined;
1511
+ constructor(kind: AiPatchStreamConnectionErrorKind, message: string, status?: number | undefined);
1512
+ }
1513
+ interface AiProviderModelsRequest {
1514
+ provider?: string;
1515
+ apiKey?: string;
1516
+ }
1517
+ interface AiProviderModelsResponse {
1518
+ provider?: string;
1519
+ success?: boolean;
1520
+ message?: string;
1521
+ models?: AiModel[];
1522
+ }
1523
+ interface AiProviderCatalogItem {
1524
+ id: string;
1525
+ label: string;
1526
+ description?: string;
1527
+ defaultModel?: string;
1528
+ requiresApiKey?: boolean;
1529
+ supportsModels?: boolean;
1530
+ supportsEmbeddings?: boolean;
1531
+ supportsTextStreaming?: boolean;
1532
+ supportsTurnCancellation?: boolean;
1533
+ iconKey?: string;
1534
+ }
1535
+ interface AiProviderCatalogResponse {
1536
+ providers: AiProviderCatalogItem[];
1537
+ }
1538
+ interface AiProviderTestRequest {
1539
+ provider?: string;
1540
+ apiKey?: string;
1541
+ model?: string;
1542
+ }
1543
+ interface AiProviderTestResponse {
1544
+ provider?: string;
1545
+ model?: string;
1546
+ success?: boolean;
1547
+ message?: string;
1548
+ }
1549
+ interface AiProviderStatusResponse {
1550
+ provider?: string;
1551
+ model?: string;
1552
+ hasApiKey?: boolean;
1553
+ source?: string;
1554
+ success?: boolean;
1555
+ message?: string;
1556
+ }
1557
+ type AiAssistantObservationFeedbackRatingValue = AiAssistantObservationFeedbackRating;
1558
+ type AiAssistantObservationFeedbackRequest = AiAssistantObservationFeedbackRequestContract;
1559
+ type AiAssistantObservationFeedbackResponse = AiAssistantObservationFeedbackResponseContract;
1560
+ interface AiContextTemplateMeta {
1561
+ variants?: Array<{
1562
+ id?: string;
1563
+ registryKey?: string;
1564
+ } | string>;
1565
+ defaultVariantId?: string;
1566
+ }
1567
+ interface AiContextTemplate {
1568
+ templateMeta?: AiContextTemplateMeta;
1569
+ }
1570
+ interface AiContextDTO {
1571
+ componentId?: string;
1572
+ componentType?: string;
1573
+ template?: AiContextTemplate | null;
1574
+ }
1575
+ interface AiHeaderContext {
1576
+ tenantId: string;
1577
+ env: string;
1578
+ userId: string;
1579
+ missing: string[];
1580
+ }
1581
+ interface AiGlobalConfigSnapshot {
1582
+ provider?: string;
1583
+ apiKey?: string;
1584
+ model?: string;
1585
+ temperature?: number;
1586
+ maxTokens?: number;
1587
+ timeout?: number;
1588
+ retryAttempts?: number;
1589
+ gatewayUrl?: string;
1590
+ riskPolicy?: string;
1591
+ }
1592
+ interface AiBackendConfigStore {
1593
+ getAiConfigSnapshot?: () => AiGlobalConfigSnapshot | null | undefined;
1594
+ aiConfigChanges$?: Observable<AiGlobalConfigSnapshot | null>;
1595
+ saveAiConfig?: (config: AiGlobalConfigSnapshot) => Promise<void>;
1596
+ }
1597
+ interface AiBackendStorageOptions {
1598
+ headersFactory?: () => Record<string, string | undefined>;
1599
+ defaultHeaders?: Record<string, string>;
1600
+ allowLocalIdentityFallback?: boolean;
1601
+ }
1602
+ interface AiBackendEndpoints {
1603
+ /**
1604
+ * Explicit base URL for `/praxis/config/ai/**`.
1605
+ * Hosts should normally prefer the shared `API_URL.default.baseUrl`; use this
1606
+ * only when AI orchestration is served by a distinct gateway.
1607
+ */
1608
+ aiBaseUrl?: string;
1609
+ /**
1610
+ * Explicit base URL for `/praxis/config/ai-context/**`.
1611
+ * When omitted, the service derives it from `API_URL.default.baseUrl`.
1612
+ */
1613
+ aiContextBaseUrl?: string;
1614
+ }
1615
+ declare const AI_BACKEND_CONFIG_STORE: InjectionToken<AiBackendConfigStore>;
1616
+ declare const AI_BACKEND_STORAGE_OPTIONS: InjectionToken<AiBackendStorageOptions>;
1617
+ declare const AI_BACKEND_ENDPOINTS: InjectionToken<AiBackendEndpoints>;
1618
+ declare class AiBackendApiService {
1619
+ private readonly http;
1620
+ private readonly globalConfigStore;
1621
+ private readonly storageOpts;
1622
+ private readonly endpointOpts;
1623
+ private readonly apiUrlConfig;
1624
+ private readonly fallbackAiBaseUrl;
1625
+ private readonly fallbackAiContextBaseUrl;
1626
+ getSuggestions(request: AiSuggestionsRequest): Observable<AiSuggestionsResponse>;
1627
+ getPatch(request: AiOrchestratorRequest): Observable<AiOrchestratorResponse>;
1628
+ startPatchStream(request: AiOrchestratorRequest): Observable<AiPatchStreamStartResponse>;
1629
+ connectPatchStream(streamId: string, lastEventId?: string, accessToken?: string): AiPatchStreamConnection;
1630
+ cancelPatchStream(streamId: string, accessToken?: string): Observable<AiPatchStreamCancelResponse>;
1631
+ startAgenticAuthoringTurnStream(request: AgenticAuthoringTurnStreamRequest): Observable<AgenticAuthoringTurnStreamStartResponse>;
1632
+ connectAgenticAuthoringTurnStream(streamId: string, lastEventId?: string, accessToken?: string): AgenticAuthoringTurnStreamConnection;
1633
+ cancelAgenticAuthoringTurnStream(streamId: string, accessToken?: string): Observable<AiPatchStreamCancelResponse>;
1634
+ sendAssistantObservationFeedback(observationId: string, request: AiAssistantObservationFeedbackRequest): Observable<AiAssistantObservationFeedbackResponse>;
1635
+ listModels(request: AiProviderModelsRequest): Observable<AiProviderModelsResponse>;
1636
+ listProviderCatalog(): Observable<AiProviderCatalogResponse>;
1637
+ testProvider(request: AiProviderTestRequest): Observable<AiProviderTestResponse>;
1638
+ getAiStatus(): Observable<AiProviderStatusResponse>;
1639
+ getAiContext(componentId: string, componentType: string): Observable<AiContextDTO>;
1640
+ getAgenticAuthoringManifest(componentId: string): Observable<AiJsonObject>;
1641
+ listAgenticAuthoringManifestTargets(componentId: string): Observable<AiJsonObject[]>;
1642
+ listAgenticAuthoringManifestOperations(componentId: string): Observable<AiJsonObject[]>;
1643
+ resolveAgenticAuthoringManifestTarget(componentId: string, request: AgenticAuthoringResolveTargetRequest): Observable<AgenticAuthoringResolvedTarget>;
1644
+ validateAgenticAuthoringManifestPlan(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable<AgenticAuthoringManifestValidationResult>;
1645
+ compileAgenticAuthoringManifestPatch(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable<AgenticAuthoringManifestCompileResult>;
1646
+ loadGlobalAiConfig(): Observable<AiGlobalConfigSnapshot | null>;
1647
+ saveGlobalAiConfig(aiConfig: AiGlobalConfigSnapshot): Observable<void>;
1648
+ getHeaderContext(): AiHeaderContext;
1649
+ private buildHeaders;
1650
+ private normalizeContractVersion;
1651
+ private normalizeContractSchemaHash;
1652
+ private normalizeLegacyPatchConversationIds;
1653
+ private normalizeConversationUuid;
1654
+ private isUuid;
1655
+ private authoringManifestUrl;
1656
+ private aiBaseUrl;
1657
+ private aiContextBaseUrl;
1658
+ private resolveBaseUrl;
1659
+ private resolveApiBaseUrl;
1660
+ private joinUrl;
1661
+ private normalizeBaseUrl;
1662
+ private buildApiUrl;
1663
+ private resolveHeaderMap;
1664
+ private parsePatchStreamEnvelope;
1665
+ private isPatchStreamEnvelope;
1666
+ private isJsonObject;
1667
+ private registerNamedStreamEventListeners;
1668
+ private isTerminalStreamEventType;
1669
+ private probePatchStreamEndpoint;
1670
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiBackendApiService, never>;
1671
+ static ɵprov: i0.ɵɵInjectableDeclaration<AiBackendApiService>;
1672
+ }
1673
+
1674
+ interface ValidationContext {
1675
+ fieldSchemas: Record<string, FieldSchemaLike>;
1676
+ targetSchemas?: any;
1677
+ propertySchema: RulePropertySchema;
1678
+ }
1679
+ declare class AiResponseValidatorService {
1680
+ /**
1681
+ * Validates the complete AI response
1682
+ */
1683
+ validate(response: AiRuleResponse, context: ValidationContext): AiValidationResult;
1684
+ private validateStructure;
1685
+ private validateTargetIds;
1686
+ private validateCondition;
1687
+ private validateJsonLogicExpression;
1688
+ private walkJsonLogicNode;
1689
+ private isSupportedJsonLogicOperator;
1690
+ private validateJsonLogicOperatorArity;
1691
+ private collectVarPaths;
1692
+ private isValidTargetId;
1693
+ private findSimilarTargetId;
1694
+ private calculateSimilarity;
1695
+ private levenshteinDistance;
1696
+ private validatePropertyType;
1697
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiResponseValidatorService, never>;
1698
+ static ɵprov: i0.ɵɵInjectableDeclaration<AiResponseValidatorService>;
1699
+ }
1700
+
1701
+ interface PraxisAssistantTurnControllerOptions {
1702
+ componentId?: string;
1703
+ componentType?: string;
1704
+ sessionId?: string;
1705
+ contextItems?: readonly PraxisAssistantShellContextItem[];
1706
+ attachments?: readonly PraxisAssistantShellAttachment[];
1707
+ currentState?: unknown;
1708
+ runtimeState?: unknown;
1709
+ schemaFields?: unknown;
1710
+ dataProfile?: unknown;
1711
+ contextHints?: Record<string, unknown>;
1712
+ }
1713
+ declare class PraxisAssistantTurnOrchestratorService {
1714
+ createController(flow: PraxisAssistantTurnFlow, options?: PraxisAssistantTurnControllerOptions): PraxisAssistantTurnController;
1715
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAssistantTurnOrchestratorService, never>;
1716
+ static ɵprov: i0.ɵɵInjectableDeclaration<PraxisAssistantTurnOrchestratorService>;
1717
+ }
1718
+ declare class PraxisAssistantTurnController {
1719
+ private readonly flow;
1720
+ private readonly options;
1721
+ private readonly stateSubject;
1722
+ readonly state$: Observable<PraxisAssistantTurnViewState>;
1723
+ private activeFlowClientTurnId;
1724
+ constructor(flow: PraxisAssistantTurnFlow, options: PraxisAssistantTurnControllerOptions);
1725
+ snapshot(): PraxisAssistantTurnViewState;
1726
+ setContextHints(hints: Record<string, unknown> | undefined): void;
1727
+ setContextItems(items: readonly PraxisAssistantShellContextItem[]): void;
1728
+ setMessages(messages: readonly PraxisAssistantShellMessage[]): void;
1729
+ setAttachments(attachments: readonly PraxisAssistantShellAttachment[]): void;
1730
+ addAttachment(attachment: PraxisAssistantShellAttachment): void;
1731
+ removeAttachment(id: string): void;
1732
+ editMessage(messageId: string, text: string): void;
1733
+ resendMessage(messageId: string): Observable<PraxisAssistantTurnViewState>;
1734
+ submitEditedMessage(messageId: string, text: string): Observable<PraxisAssistantTurnViewState>;
1735
+ submitPrompt(prompt: string, action?: PraxisAssistantTurnAction): Observable<PraxisAssistantTurnViewState>;
1736
+ answerClarification(option: PraxisAssistantClarificationOption | string): Observable<PraxisAssistantTurnViewState>;
1737
+ private semanticClarificationContextHints;
1738
+ apply(): Observable<PraxisAssistantTurnViewState>;
1739
+ retry(): Observable<PraxisAssistantTurnViewState>;
1740
+ cancel(): Observable<PraxisAssistantTurnViewState>;
1741
+ private runFlow;
1742
+ private buildRequest;
1743
+ private submitExistingUserMessage;
1744
+ private findUserMessageIndex;
1745
+ private resetReplayState;
1746
+ private resetActiveTurnState;
1747
+ private shouldApplyFlowResult;
1748
+ private resetConversationState;
1749
+ private resetConversationAfterCancel;
1750
+ private applyResult;
1751
+ private resolveSubmitAction;
1752
+ private buildPendingClarification;
1753
+ private resolvePendingClarificationSourcePrompt;
1754
+ private resolveMessageRole;
1755
+ private resolvePhase;
1756
+ private buildMessage;
1757
+ private shouldAttachObservationId;
1758
+ private createId;
1759
+ private patchState;
1760
+ private cloneState;
1761
+ private toObservable;
1762
+ private buildFlowErrorResult;
1763
+ private describeFlowError;
1764
+ private serializeFlowError;
1765
+ private toRecord;
1766
+ private toString;
1767
+ private toNumber;
1768
+ }
1769
+
1770
+ declare function toPraxisAssistantClarificationOption(reply: PraxisAssistantShellQuickReply): PraxisAssistantClarificationOption;
1771
+ declare function submitPraxisAssistantQuickReply(controller: PraxisAssistantTurnController, reply: PraxisAssistantShellQuickReply): Observable<PraxisAssistantTurnViewState>;
1772
+
1773
+ type PraxisAssistantSessionVisibility = 'active' | 'minimized';
1774
+ type PraxisAssistantSessionPresence = 'global-dock' | 'origin-anchor';
1775
+ interface PraxisAssistantSessionDescriptor {
1776
+ id: string;
1777
+ ownerId: string;
1778
+ ownerType: string;
1779
+ title: string;
1780
+ summary?: string | null;
1781
+ mode?: PraxisAssistantShellMode | null;
1782
+ state?: PraxisAssistantShellState | null;
1783
+ visibility?: PraxisAssistantSessionVisibility | null;
1784
+ contextItems?: readonly PraxisAssistantShellContextItem[] | null;
1785
+ contextSnapshot?: PraxisAssistantContextSnapshot | null;
1786
+ badge?: string | null;
1787
+ icon?: string | null;
1788
+ presence?: PraxisAssistantSessionPresence | null;
1789
+ updatedAt?: string | null;
1790
+ }
1791
+ interface PraxisAssistantSessionSnapshot {
1792
+ id: string;
1793
+ ownerId: string;
1794
+ ownerType: string;
1795
+ title: string;
1796
+ summary: string;
1797
+ mode: PraxisAssistantShellMode;
1798
+ state: PraxisAssistantShellState;
1799
+ visibility: PraxisAssistantSessionVisibility;
1800
+ contextItems: readonly PraxisAssistantShellContextItem[];
1801
+ contextSnapshot: PraxisAssistantContextSnapshot | null;
1802
+ badge: string;
1803
+ icon: string;
1804
+ presence: PraxisAssistantSessionPresence;
1805
+ createdAt: string;
1806
+ updatedAt: string;
1807
+ }
1808
+ type PraxisAssistantSessionIdentityRef = string | PraxisAssistantIdentity | PraxisAssistantContextSnapshot;
1809
+ type PraxisAssistantContextSessionDescriptor = Omit<PraxisAssistantSessionDescriptor, 'id' | 'ownerId' | 'ownerType' | 'title' | 'contextSnapshot'> & {
1810
+ title?: string;
1811
+ };
1812
+ declare class PraxisAssistantSessionRegistryService {
1813
+ private readonly sessionsState;
1814
+ readonly sessions: i0.Signal<PraxisAssistantSessionSnapshot[]>;
1815
+ readonly activeSession: i0.Signal<PraxisAssistantSessionSnapshot | null>;
1816
+ readonly minimizedSessions: i0.Signal<PraxisAssistantSessionSnapshot[]>;
1817
+ upsertSession(descriptor: PraxisAssistantSessionDescriptor): PraxisAssistantSessionSnapshot;
1818
+ upsertContextSession(contextSnapshot: PraxisAssistantContextSnapshot, descriptor?: PraxisAssistantContextSessionDescriptor): PraxisAssistantSessionSnapshot;
1819
+ openSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
1820
+ openContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null;
1821
+ minimizeSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
1822
+ minimizeContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null;
1823
+ removeSession(sessionId: string): void;
1824
+ removeContextSession(identity: PraxisAssistantSessionIdentityRef): void;
1825
+ getSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
1826
+ getContextSession(identity: PraxisAssistantSessionIdentityRef): PraxisAssistantSessionSnapshot | null;
1827
+ clear(): void;
1828
+ private setVisibility;
1829
+ private resolveSessionId;
1830
+ private normalizeDescriptor;
1831
+ private assertContextIdentity;
1832
+ private toShellContextItems;
1833
+ private sortSessions;
1834
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAssistantSessionRegistryService, never>;
1835
+ static ɵprov: i0.ɵɵInjectableDeclaration<PraxisAssistantSessionRegistryService>;
1836
+ }
1837
+
1838
+ type AssistantMessageRole = 'user' | 'assistant' | 'system';
1839
+ interface AssistantHistoryMessage {
1840
+ id: string;
1841
+ role: AssistantMessageRole;
1842
+ text: string;
1843
+ createdAt: string;
1844
+ context?: {
1845
+ componentId?: string;
1846
+ componentType?: string;
1847
+ variantId?: string;
1848
+ suggestionId?: string;
1849
+ usedRag?: boolean;
1850
+ };
1851
+ }
1852
+ interface AssistantHistorySession {
1853
+ id: string;
1854
+ title: string;
1855
+ tenantId: string;
1856
+ env: string;
1857
+ userId: string;
1858
+ componentId?: string;
1859
+ componentType?: string;
1860
+ serverSessionId?: string | null;
1861
+ createdAt: string;
1862
+ updatedAt: string;
1863
+ messages: AssistantHistoryMessage[];
1864
+ summary?: string;
1865
+ }
1866
+ interface AssistantHistoryContext extends AiHeaderContext {
1867
+ storageAvailable: boolean;
1868
+ }
1869
+
1870
+ type AssistantState = 'idle' | 'listening' | 'clarification' | 'processing' | 'review' | 'applying' | 'success' | 'error';
1871
+
1872
+ interface ClarificationOption {
1873
+ label: string;
1874
+ value: string;
1875
+ example?: string;
1876
+ }
1877
+ type ClarificationContextHints = AiContextHintsContract;
1878
+ interface ClarificationRichOption extends ClarificationOption {
1879
+ contextHints?: ClarificationContextHints;
1880
+ }
1881
+ interface PatchPathEdit {
1882
+ path: string;
1883
+ valueText: string;
1884
+ error?: string;
1885
+ }
1886
+ type RiskPolicy = 'strict' | 'standard';
1887
+ type ReviewRiskLevel = 'baixo' | 'médio' | 'alto';
1888
+ declare class PraxisAiAssistantComponent implements OnDestroy {
1889
+ adapter: AiConfigAdapter;
1890
+ riskPolicy: RiskPolicy | null;
1891
+ allowManualPatchEdit: boolean;
1892
+ hasBackdrop: boolean;
1893
+ readonly overlayPositions: ConnectedPosition[];
1894
+ overlayOrigin: CdkOverlayOrigin;
1895
+ triggerButton?: ElementRef<HTMLButtonElement>;
1896
+ inputElement: ElementRef<HTMLInputElement>;
1897
+ state: AssistantState | 'clarification';
1898
+ activeTab: 'task' | 'chat' | 'suggestions';
1899
+ private readonly tabOrder;
1900
+ readonly flowSteps: readonly [{
1901
+ readonly step: 1;
1902
+ readonly label: "Pedido";
1903
+ }, {
1904
+ readonly step: 2;
1905
+ readonly label: "Proposta";
1906
+ }, {
1907
+ readonly step: 3;
1908
+ readonly label: "Impacto";
1909
+ }, {
1910
+ readonly step: 4;
1911
+ readonly label: "Aplicação";
1912
+ }];
1913
+ private taskFlowActive;
1914
+ processingInfoVisible: boolean;
1915
+ isOpen: boolean;
1916
+ loadingSuggestions: boolean;
1917
+ userPrompt: string;
1918
+ aiExplanation: string;
1919
+ pendingPatch: Record<string, unknown> | null;
1920
+ pendingDiff: AiPatchDiff[];
1921
+ patchEditorText: string;
1922
+ patchEditorError: string;
1923
+ patchEditorExpanded: boolean;
1924
+ patchPathEditorExpanded: boolean;
1925
+ patchPathEdits: PatchPathEdit[];
1926
+ patchPathEditorError: string;
1927
+ applyWarnings: string[];
1928
+ lastApplyAt: string | null;
1929
+ lastSnapshot: unknown;
1930
+ errorMsg: string;
1931
+ warnings: string[];
1932
+ private backendRiskLevel;
1933
+ private backendRequiresConfirmation;
1934
+ private effectiveRiskPolicy;
1935
+ suggestionsWarnings: string[];
1936
+ mockMode: boolean;
1937
+ clarificationMessage: string;
1938
+ clarificationOptions: ClarificationRichOption[];
1939
+ clarificationQuestions: string[];
1940
+ clarificationAnswers: string[];
1941
+ clarificationFreeText: string;
1942
+ showManualInput: boolean;
1943
+ private clarificationBasePrompt;
1944
+ private skipClarificationAppend;
1945
+ clarificationResponseType: 'text' | 'choice' | 'confirm' | 'mixed' | 'context';
1946
+ clarificationSelectionMode: 'single' | 'multiple';
1947
+ clarificationAllowCustom: boolean;
1948
+ clarificationPresentation: 'buttons' | 'list' | 'chips';
1949
+ selectedClarificationOptions: ClarificationRichOption[];
1950
+ richSuggestions: AiSuggestion[];
1951
+ private dismissedSuggestionIds;
1952
+ private readonly aiApi;
1953
+ private readonly historyService;
1954
+ private readonly dialog;
1955
+ private readonly cdr;
1956
+ private readonly suggestionsCache;
1957
+ private readonly templateVariantsCache;
1958
+ private activeVariantId;
1959
+ private promptFromSuggestion;
1960
+ private activeSuggestion;
1961
+ private activeContextHints;
1962
+ private activeResourcePath;
1963
+ private activeServerSessionId;
1964
+ private activeStreamId;
1965
+ private activeStreamAccessToken;
1966
+ private activeStreamConnection;
1967
+ private streamSeenEventIds;
1968
+ private streamLastSeqByStream;
1969
+ private streamLastEventIdByStream;
1970
+ private streamLastSeq;
1971
+ private streamLastEventId;
1972
+ private streamTerminalState;
1973
+ private streamTimelineMode;
1974
+ private streamFallbackActive;
1975
+ private streamTimelineStepState;
1976
+ private streamTimelineStepDetail;
1977
+ private currentComponentId;
1978
+ private currentComponentType;
1979
+ private forceNewSession;
1980
+ private readonly sessionStorageAvailable;
1981
+ historyContext: AssistantHistoryContext | null;
1982
+ historyWarnings: string[];
1983
+ historySessions: Array<{
1984
+ id: string;
1985
+ title: string;
1986
+ updatedAt: string;
1987
+ componentId?: string;
1988
+ componentType?: string;
1989
+ }>;
1990
+ activeHistorySession: AssistantHistorySession | null;
1991
+ activeHistoryMessages: AssistantHistoryMessage[];
1992
+ activeHistoryTotalMessages: number;
1993
+ historyExpanded: boolean;
1994
+ historyUndoDeleteSession: AssistantHistorySession | null;
1995
+ private historyUndoTimerId;
1996
+ highlightClarificationDetails: boolean;
1997
+ highlightReviewDetails: boolean;
1998
+ private thoughtDetailsHighlightTimerId;
1999
+ showFullDiff: boolean;
2000
+ private processingStartedAt;
2001
+ private lastProcessingDurationMs;
2002
+ private readonly westernTwoDigitFormatter;
2003
+ private readonly maxHistoryMessages;
2004
+ ngOnDestroy(): void;
2005
+ open(): Promise<void>;
2006
+ close(): void;
2007
+ submitPrompt(overridePrompt?: string): Promise<void>;
2008
+ isTaskMode(): boolean;
2009
+ hasPendingClarification(): boolean;
2010
+ isActiveTab(tab: 'task' | 'chat' | 'suggestions'): boolean;
2011
+ setActiveTab(tab: 'task' | 'chat' | 'suggestions'): void;
2012
+ onTabsKeydown(event: KeyboardEvent): void;
2013
+ private focusTab;
2014
+ getTaskTitle(): string;
2015
+ getTaskSubtitle(): string;
2016
+ getTaskPrimaryLabel(): string;
2017
+ getTaskSecondaryLabel(): string;
2018
+ getTaskCancelLabel(): string;
2019
+ isTaskPrimaryDisabled(): boolean;
2020
+ isBusyState(): boolean;
2021
+ getSystemStatusLabel(): string;
2022
+ getSystemStatusDetail(): string;
2023
+ shouldShowSystemStatusDetail(): boolean;
2024
+ getSystemStatusAriaLive(): 'polite' | 'assertive';
2025
+ shouldShowSnapshotFallbackBadge(): boolean;
2026
+ getRiskPolicyLabel(): string;
2027
+ getRiskPolicyTooltip(): string;
2028
+ isStrictRiskPolicy(): boolean;
2029
+ getFlowStepState(step: number): 'done' | 'active' | 'pending';
2030
+ getFlowStepDetail(step: number): string;
2031
+ shouldShowTaskFlow(): boolean;
2032
+ shouldShowThoughtCard(): boolean;
2033
+ getThoughtTimingLabel(): string;
2034
+ getThoughtSummary(): string;
2035
+ getThoughtPlanTitle(): string;
2036
+ getThoughtChecklist(): string[];
2037
+ openThoughtDetails(): void;
2038
+ openThoughtPreview(): void;
2039
+ getThoughtDetailsTooltip(): string;
2040
+ getThoughtDetailsLabel(): string;
2041
+ getThoughtPreviewTooltip(): string;
2042
+ getThoughtActionHint(): string;
2043
+ shouldShowThoughtPreviewAction(): boolean;
2044
+ shouldShowTaskTimeline(): boolean;
2045
+ getTaskTimelineItems(): Array<{
2046
+ step: number;
2047
+ title: string;
2048
+ detail: string;
2049
+ state: 'done' | 'active' | 'pending';
2050
+ }>;
2051
+ private getThoughtDurationSeconds;
2052
+ private formatDurationClock;
2053
+ private formatWesternTwoDigits;
2054
+ getReviewRiskLevel(): ReviewRiskLevel;
2055
+ getReviewSummary(): string;
2056
+ getDiffToggleLabel(): string;
2057
+ private getReviewChangeCount;
2058
+ private estimatePatchChangeCount;
2059
+ private getCurrentFlowStep;
2060
+ private resolveCurrentFlowStepFromStream;
2061
+ private shouldUseStreamTimeline;
2062
+ private initializeStreamTimeline;
2063
+ private markStreamStep;
2064
+ shouldShowTaskSteps(): boolean;
2065
+ getTaskSelectionSummary(): string | null;
2066
+ getHistorySessionTooltip(session: {
2067
+ componentType?: string;
2068
+ componentId?: string;
2069
+ }): string;
2070
+ getVisibleSuggestions(): AiSuggestion[];
2071
+ hasDismissedSuggestions(): boolean;
2072
+ getDismissedSuggestionCount(): number;
2073
+ restoreDismissedSuggestions(): void;
2074
+ isDatasetSelection(): boolean;
2075
+ hasClarificationSelection(): boolean;
2076
+ confirmTaskAction(): void;
2077
+ handleTaskSecondary(): void;
2078
+ onClarificationOptionClick(opt: ClarificationRichOption): void;
2079
+ toggleManualInput(): void;
2080
+ private toggleClarificationSelection;
2081
+ private setState;
2082
+ private flashThoughtDetails;
2083
+ private clearThoughtDetailsHighlightTimer;
2084
+ private focusTaskPanelTarget;
2085
+ toggleFullDiff(): void;
2086
+ getDiffSummaryLines(): string[];
2087
+ private summarizeDiff;
2088
+ shouldShowApplyDetails(): boolean;
2089
+ getApplyPaths(): string[];
2090
+ getEditablePatchPathEdits(): PatchPathEdit[];
2091
+ togglePatchEditor(): void;
2092
+ resetPatchEditor(): void;
2093
+ togglePatchPathEditor(): void;
2094
+ resetPatchPathEdits(): void;
2095
+ applyPathEditsToPatch(): boolean;
2096
+ reapplyPathEdits(): Promise<void>;
2097
+ reapplyEditedPatch(): Promise<void>;
2098
+ private confirmEditedPatchBeforeApply;
2099
+ getScopeLabel(): string;
2100
+ getScopeTooltip(): string;
2101
+ getConfidenceLabel(): string;
2102
+ getConfidenceTooltip(): string;
2103
+ isClarificationSelected(option: ClarificationRichOption): boolean;
2104
+ getClarificationOptionLayout(option: ClarificationRichOption): 'endpoint' | 'color' | 'description' | 'default';
2105
+ getClarificationOptionKindLabel(option: ClarificationRichOption): string;
2106
+ isEndpointOption(option: ClarificationRichOption): boolean;
2107
+ isColorOption(option: ClarificationRichOption): boolean;
2108
+ hasRichDescription(option: ClarificationRichOption): boolean;
2109
+ getEndpointIcon(option: ClarificationRichOption): string;
2110
+ getEndpointMethod(option: ClarificationRichOption): string | null;
2111
+ getEndpointPath(option: ClarificationRichOption): string | null;
2112
+ shouldShowClarificationTooltip(option: ClarificationRichOption): boolean;
2113
+ getClarificationTooltip(option: ClarificationRichOption): string;
2114
+ getSafeHexColor(option: ClarificationRichOption): string | null;
2115
+ shouldShowDescriptionTooltip(option: ClarificationRichOption): boolean;
2116
+ getDescriptionTooltip(option: ClarificationRichOption): string;
2117
+ shouldShowDescription(option: ClarificationRichOption): boolean;
2118
+ handleClarificationOption(option: ClarificationRichOption | string): Promise<void>;
2119
+ confirmPatch(): Promise<void>;
2120
+ private requiresApplyConfirmation;
2121
+ private confirmRiskApply;
2122
+ private buildRiskConfirmationMessage;
2123
+ private openConfirmationDialog;
2124
+ private normalizeRiskLevel;
2125
+ undoLastChange(): Promise<void>;
2126
+ retry(): void;
2127
+ private applyPatchPayload;
2128
+ private parsePatchEditorText;
2129
+ private collectPatchPaths;
2130
+ private serializePatch;
2131
+ private syncPatchPathEdits;
2132
+ private serializePathValue;
2133
+ private collectEditablePatchPaths;
2134
+ private parsePathEditValue;
2135
+ private getPatchValueAtPath;
2136
+ private setPatchValueAtPath;
2137
+ private tokenizePatchPath;
2138
+ private clonePatch;
2139
+ prepareSuggestionPrompt(sug: AiSuggestion, event?: Event): void;
2140
+ dismissSuggestion(sug: AiSuggestion, event?: Event): void;
2141
+ onSuggestionCardKeydown(event: KeyboardEvent, sug: AiSuggestion): void;
2142
+ selectSuggestion(sug: AiSuggestion): void;
2143
+ refreshSuggestions(): Promise<void>;
2144
+ submitClarificationSelection(): Promise<void>;
2145
+ startNewSession(resetUi?: boolean): void;
2146
+ clearHistory(): Promise<void>;
2147
+ removeHistorySession(sessionId: string, event?: Event): Promise<void>;
2148
+ onHistorySessionCardKeydown(event: KeyboardEvent, sessionId: string): void;
2149
+ reuseHistorySessionPrompt(sessionId: string, event?: Event): void;
2150
+ undoRemoveHistorySession(): void;
2151
+ selectHistorySession(sessionId: string): void;
2152
+ private loadSuggestions;
2153
+ private getPatchViaStreamWithFallback;
2154
+ private consumePatchStream;
2155
+ private applyStreamEvent;
2156
+ private resolveStreamTimeoutMs;
2157
+ private resolveStreamIdleTimeoutMs;
2158
+ private acceptStreamEvent;
2159
+ private resolveLastEventIdForStream;
2160
+ private extractStreamMessage;
2161
+ private requestStreamCancel;
2162
+ private closeActiveStreamConnection;
2163
+ private resetStreamTracking;
2164
+ private shouldFallbackToPatch;
2165
+ private compileAdapterResponse;
2166
+ private handlePatchResponse;
2167
+ private initHistory;
2168
+ private buildHistoryWarnings;
2169
+ private matchesHistoryContext;
2170
+ private buildClientTurnId;
2171
+ private buildUiContextRef;
2172
+ private buildCurrentStateDigest;
2173
+ private inferAiMode;
2174
+ private resolveRouteKey;
2175
+ private resolveSchemaHash;
2176
+ private checkSessionStorage;
2177
+ private resolveSessionStorageKey;
2178
+ private restoreServerSessionId;
2179
+ private persistServerSessionId;
2180
+ private appendHistoryMessage;
2181
+ private appendHistoryAssistantResponse;
2182
+ private resolveAssistantSummary;
2183
+ private isProcessingMessage;
2184
+ retryProcessing(): Promise<void>;
2185
+ private cancelProcessing;
2186
+ private withSnapshotFallbackDetail;
2187
+ private resolveUsedRag;
2188
+ private sliceHistoryMessages;
2189
+ private applyClarificationUi;
2190
+ private resolveClarificationPresentation;
2191
+ private resetAssistantStateForSession;
2192
+ private setHistoryUndo;
2193
+ private clearPendingHistoryUndo;
2194
+ private clearHistoryUndoTimer;
2195
+ private pruneDismissedSuggestions;
2196
+ private confirmHistoryClear;
2197
+ private enterClarification;
2198
+ private enterClarificationWithOptions;
2199
+ private enterClarificationWithQuestions;
2200
+ private resolveClarificationOptions;
2201
+ private enrichClarification;
2202
+ private buildClarificationAnswers;
2203
+ private needsRuleClarification;
2204
+ private needsValueColorClarification;
2205
+ private needsBadgeValueClarification;
2206
+ private normalizeMissingContext;
2207
+ private resolveBadgeContextHints;
2208
+ private hasBadgeValues;
2209
+ private hasBadgeColors;
2210
+ private hasBadgeField;
2211
+ private mergeContextHints;
2212
+ private enrichDomainCatalogAuthoringHints;
2213
+ private setResourcePathHint;
2214
+ private clearResourcePathHint;
2215
+ private matchClarificationOptionPath;
2216
+ private normalizeResourcePath;
2217
+ private extractResourcePath;
2218
+ private asRecord;
2219
+ private toAiJsonObject;
2220
+ private toAiJsonValue;
2221
+ private toClarificationContextHints;
2222
+ private firstNonBlank;
2223
+ private buildRuleClarificationPayloads;
2224
+ private buildValueColorClarificationPayloads;
2225
+ private resolveBadgeValuesContext;
2226
+ private resolveSchemaField;
2227
+ private extractSchemaValues;
2228
+ private extractOptionValueFromSchema;
2229
+ private normalizeOptionKey;
2230
+ private normalizeStringList;
2231
+ private buildValueColorMap;
2232
+ private findColumnInPrompt;
2233
+ private extractOptionValue;
2234
+ private buildMaskSelectionHints;
2235
+ private extractMaskFromText;
2236
+ private resolveComponentId;
2237
+ private resolveComponentType;
2238
+ private buildSuggestionsRequest;
2239
+ private resolveLocale;
2240
+ private resolveConfigRoot;
2241
+ private resolveMockMode;
2242
+ private resolveConfiguredRiskPolicy;
2243
+ private getEffectiveRiskPolicy;
2244
+ private normalizeRiskPolicy;
2245
+ private hasProviderOverride;
2246
+ private resolveMockModeFromStatus;
2247
+ private loadTemplateVariants;
2248
+ private extractVariantIds;
2249
+ private resolveVariantIdForSuggestion;
2250
+ private mapSuggestionToVariantId;
2251
+ private getTemplateVariants;
2252
+ private includesAny;
2253
+ private buildSuggestionsCacheKey;
2254
+ private stableStringify;
2255
+ private hashString;
2256
+ private isTable;
2257
+ private isForm;
2258
+ private extractColumnNames;
2259
+ private extractFieldNames;
2260
+ onKeydown(event: KeyboardEvent): void;
2261
+ private shouldSubmitFromKeydown;
2262
+ private restoreFocusToTrigger;
2263
+ private normalizeError;
2264
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantComponent, never>;
2265
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisAiAssistantComponent, "praxis-ai-assistant", never, { "adapter": { "alias": "adapter"; "required": true; }; "riskPolicy": { "alias": "riskPolicy"; "required": false; }; "allowManualPatchEdit": { "alias": "allowManualPatchEdit"; "required": false; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; }, {}, never, never, true, never>;
2266
+ }
2267
+
2268
+ type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
2269
+ type QuickReplyPresentationItem = PraxisAssistantShellQuickReplyPresentationItem & {
2270
+ key: 'bestFor' | 'returns' | 'nextStep' | string;
2271
+ icon: string;
2272
+ };
2273
+ interface QuickReplyContextChip {
2274
+ icon: string;
2275
+ value: string;
2276
+ ariaLabel: string;
2277
+ }
2278
+ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
2279
+ labels: Partial<PraxisAssistantShellLabels> | null;
2280
+ mode: PraxisAssistantShellMode;
2281
+ state: PraxisAssistantShellState;
2282
+ contextItems: readonly PraxisAssistantShellContextItem[];
2283
+ attachments: readonly PraxisAssistantShellAttachment[];
2284
+ messages: readonly PraxisAssistantShellMessage[];
2285
+ quickReplies: readonly PraxisAssistantShellQuickReply[];
2286
+ recommendedIntents: readonly PraxisAssistantRecommendedIntent[];
2287
+ prompt: string;
2288
+ statusText: string;
2289
+ errorText: string;
2290
+ testIdPrefix: string;
2291
+ panelTestId: string;
2292
+ submitTestId: string;
2293
+ applyTestId: string;
2294
+ primaryAction: PraxisAssistantShellAction | null;
2295
+ secondaryActions: readonly PraxisAssistantShellAction[];
2296
+ governanceActions: readonly PraxisAssistantShellAction[];
2297
+ busy: boolean;
2298
+ canSubmit: boolean;
2299
+ canApply: boolean;
2300
+ submitOnEnter: boolean;
2301
+ showAttachAction: boolean;
2302
+ enablePastedAttachments: boolean;
2303
+ enableFileAttachments: boolean;
2304
+ attachmentAccept: string;
2305
+ attachmentMultiple: boolean;
2306
+ private readonly defaultVoiceInputMode;
2307
+ private readonly defaultVoiceLanguage;
2308
+ voiceInputMode: PraxisAssistantVoiceInputMode;
2309
+ voiceLanguage: string;
2310
+ draggable: boolean;
2311
+ resizable: boolean;
2312
+ minWidth: number;
2313
+ minHeight: number;
2314
+ margin: number;
2315
+ layout: PraxisAssistantShellLayout;
2316
+ promptChange: EventEmitter<string>;
2317
+ submitPrompt: EventEmitter<string>;
2318
+ apply: EventEmitter<void>;
2319
+ retryTurn: EventEmitter<void>;
2320
+ cancelTurn: EventEmitter<void>;
2321
+ shellAction: EventEmitter<PraxisAssistantShellAction>;
2322
+ close: EventEmitter<void>;
2323
+ attach: EventEmitter<void>;
2324
+ attachmentsPasted: EventEmitter<PraxisAssistantShellAttachment[]>;
2325
+ attachmentsSelected: EventEmitter<PraxisAssistantShellAttachment[]>;
2326
+ removeAttachment: EventEmitter<PraxisAssistantShellAttachment>;
2327
+ messageAction: EventEmitter<{
2328
+ message: PraxisAssistantShellMessage;
2329
+ action: PraxisAssistantShellMessageAction;
2330
+ }>;
2331
+ editMessage: EventEmitter<PraxisAssistantShellMessage>;
2332
+ resendMessage: EventEmitter<PraxisAssistantShellMessage>;
2333
+ quickReply: EventEmitter<PraxisAssistantShellQuickReply>;
2334
+ recommendedIntent: EventEmitter<PraxisAssistantRecommendedIntent>;
2335
+ layoutChange: EventEmitter<PraxisAssistantShellLayout>;
2336
+ panel?: ElementRef<HTMLElement>;
2337
+ conversation?: ElementRef<HTMLElement>;
2338
+ private readonly cdr;
2339
+ private readonly injector;
2340
+ private readonly browserSpeech;
2341
+ protected currentPrompt: string;
2342
+ protected resolvedLabels: PraxisAssistantShellLabels;
2343
+ protected voiceCaptureState: PraxisAssistantVoiceCaptureState;
2344
+ protected voiceFeedbackText: string;
2345
+ protected currentLayout: PraxisAssistantShellLayout;
2346
+ protected readonly resizeHandles: readonly ResizeDirection[];
2347
+ private pointerSession;
2348
+ private readonly ownedPreviewUrls;
2349
+ private readonly submittedFeedbackObservationIds;
2350
+ private voiceCaptureSequence;
2351
+ private destroyed;
2352
+ private readonly onWindowPointerMove;
2353
+ private readonly onWindowPointerUp;
2354
+ ngOnChanges(changes: SimpleChanges): void;
2355
+ ngOnDestroy(): void;
2356
+ protected onPromptInput(value: string): void;
2357
+ protected onSubmit(): void;
2358
+ protected onPromptKeydown(event: KeyboardEvent): void;
2359
+ protected onPromptPaste(event: ClipboardEvent): void;
2360
+ protected onVoiceInputClick(): void;
2361
+ protected shouldShowVoiceInput(): boolean;
2362
+ protected isVoiceInputDisabled(): boolean;
2363
+ protected isVoiceInputBusy(): boolean;
2364
+ protected getVoiceActionLabel(): string;
2365
+ protected shouldShowVoiceFeedback(): boolean;
2366
+ private canUseBrowserSpeech;
2367
+ private cancelVoiceCapture;
2368
+ private isCurrentVoiceCapture;
2369
+ private applyVoiceTranscript;
2370
+ private resolveVoiceErrorText;
2371
+ private getVoiceLabel;
2372
+ protected onAttachClick(fileInput: HTMLInputElement): void;
2373
+ protected onAttachmentFilesSelected(event: Event): void;
2374
+ protected onApply(): void;
2375
+ protected renderMessageText(text: string | null | undefined): string;
2376
+ private renderInlineMarkdown;
2377
+ private escapeHtml;
2378
+ protected shouldShowStatusText(): boolean;
2379
+ protected shouldShowErrorText(): boolean;
2380
+ protected onShellAction(action: PraxisAssistantShellAction): void;
2381
+ protected getPrimaryAction(): PraxisAssistantShellAction;
2382
+ protected getSecondaryActions(): readonly PraxisAssistantShellAction[];
2383
+ protected getPrimaryActionTooltip(action: PraxisAssistantShellAction): string;
2384
+ protected isShellActionDisabled(action: PraxisAssistantShellAction): boolean;
2385
+ protected getShellActionTone(action: PraxisAssistantShellAction): string;
2386
+ protected trackShellAction(_index: number, action: PraxisAssistantShellAction): string;
2387
+ private hasRecoverableTurn;
2388
+ private shouldShowAuxiliaryText;
2389
+ private normalizeMessageText;
2390
+ private getDefaultPrimaryAction;
2391
+ protected onQuickReply(reply: PraxisAssistantShellQuickReply): void;
2392
+ protected shouldShowRecommendedIntents(): boolean;
2393
+ protected onRecommendedIntent(intent: PraxisAssistantRecommendedIntent): void;
2394
+ protected isRecommendedIntentDisabled(intent: PraxisAssistantRecommendedIntent): boolean;
2395
+ protected getRecommendedIntentAriaLabel(intent: PraxisAssistantRecommendedIntent): string;
2396
+ protected getRecommendedIntentDescription(intent: PraxisAssistantRecommendedIntent): string;
2397
+ protected getRecommendedIntentCtaLabel(intent: PraxisAssistantRecommendedIntent): string;
2398
+ protected getRecommendedIntentIcon(intent: PraxisAssistantRecommendedIntent): string;
2399
+ protected getRecommendedIntentTone(intent: PraxisAssistantRecommendedIntent): string;
2400
+ protected getRecommendedIntentGroupLabel(intent: PraxisAssistantRecommendedIntent): string;
2401
+ protected getQuickReplyAriaLabel(reply: PraxisAssistantShellQuickReply): string;
2402
+ protected getQuickReplyTechnicalDetails(reply: PraxisAssistantShellQuickReply): string;
2403
+ protected isRichQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
2404
+ protected shouldUseInlineQuickReplies(): boolean;
2405
+ protected getQuickReplyDescription(reply: PraxisAssistantShellQuickReply): string;
2406
+ protected getQuickReplyContextChips(reply: PraxisAssistantShellQuickReply): readonly QuickReplyContextChip[];
2407
+ protected getQuickReplyPresentationItems(reply: PraxisAssistantShellQuickReply): readonly QuickReplyPresentationItem[];
2408
+ private defaultQuickReplyPresentation;
2409
+ protected getQuickReplyCategoryLabel(reply: PraxisAssistantShellQuickReply): string;
2410
+ protected getQuickReplyIcon(reply: PraxisAssistantShellQuickReply): string;
2411
+ protected getQuickReplyCtaLabel(reply: PraxisAssistantShellQuickReply): string;
2412
+ protected getQuickReplyTone(reply: PraxisAssistantShellQuickReply): string;
2413
+ private normalizeQuickReplyTone;
2414
+ private asRecord;
2415
+ private stringHint;
2416
+ private quickReplyHint;
2417
+ private hasQuickReplyResourceContext;
2418
+ private isFieldDiscoveryQuickReply;
2419
+ protected isContextualPreviewActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
2420
+ protected isGuidedActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
2421
+ private quickReplyPresentation;
2422
+ private quickReplyPresentationKind;
2423
+ private presentationEvidenceToChip;
2424
+ private getContextualActionChips;
2425
+ private isGenericContextualActionDescription;
2426
+ private trimSentencePunctuation;
2427
+ private shortPathLabel;
2428
+ private shortTechnicalLabel;
2429
+ protected getCloseIcon(): string;
2430
+ private normalizeShellAction;
2431
+ protected onRemoveAttachment(attachment: PraxisAssistantShellAttachment): void;
2432
+ protected onMessageAction(message: PraxisAssistantShellMessage, action: PraxisAssistantShellMessageAction): void;
2433
+ protected canSendMessageFeedback(message: PraxisAssistantShellMessage): boolean;
2434
+ protected isMessageFeedbackSubmitted(message: PraxisAssistantShellMessage): boolean;
2435
+ protected sendMessageFeedback(message: PraxisAssistantShellMessage, rating: AiAssistantObservationFeedbackRatingValue): void;
2436
+ private resolveAiApi;
2437
+ protected getMessageActionIcon(action: PraxisAssistantShellMessageAction): string;
2438
+ protected getMessageActionLabel(action: PraxisAssistantShellMessageAction): string;
2439
+ protected isMessageActionIconOnly(action: PraxisAssistantShellMessageAction): boolean;
2440
+ protected getModeLabel(): string;
2441
+ protected getStateLabel(): string;
2442
+ protected startDrag(event: PointerEvent): void;
2443
+ protected startResize(direction: ResizeDirection, event: PointerEvent): void;
2444
+ protected trackResizeHandle(_index: number, direction: ResizeDirection): ResizeDirection;
2445
+ protected trackMessage(_index: number, message: PraxisAssistantShellMessage): string;
2446
+ protected trackMessageAction(_index: number, action: PraxisAssistantShellMessageAction): string;
2447
+ protected trackQuickReply(_index: number, reply: PraxisAssistantShellQuickReply): string;
2448
+ protected trackRecommendedIntent(_index: number, intent: PraxisAssistantRecommendedIntent): string;
2449
+ protected trackContextItem(_index: number, item: PraxisAssistantShellContextItem): string;
2450
+ protected trackAttachment(_index: number, attachment: PraxisAssistantShellAttachment): string;
2451
+ private startPointerSession;
2452
+ private handlePointerMove;
2453
+ private resizeLayout;
2454
+ private finishPointerSession;
2455
+ private detachPointerListeners;
2456
+ private resolveViewportBounds;
2457
+ private normalizeLayout;
2458
+ private clampLayout;
2459
+ private clamp;
2460
+ private scheduleConversationScroll;
2461
+ private fileAttachment;
2462
+ private createAttachmentId;
2463
+ private attachmentKind;
2464
+ private revokeDetachedPastedPreviewUrls;
2465
+ private revokeAllOwnedPreviewUrls;
2466
+ private revokeOwnedPreviewUrl;
2467
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantShellComponent, never>;
2468
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisAiAssistantShellComponent, "praxis-ai-assistant-shell", never, { "labels": { "alias": "labels"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "state": { "alias": "state"; "required": false; }; "contextItems": { "alias": "contextItems"; "required": false; }; "attachments": { "alias": "attachments"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "quickReplies": { "alias": "quickReplies"; "required": false; }; "recommendedIntents": { "alias": "recommendedIntents"; "required": false; }; "prompt": { "alias": "prompt"; "required": false; }; "statusText": { "alias": "statusText"; "required": false; }; "errorText": { "alias": "errorText"; "required": false; }; "testIdPrefix": { "alias": "testIdPrefix"; "required": false; }; "panelTestId": { "alias": "panelTestId"; "required": false; }; "submitTestId": { "alias": "submitTestId"; "required": false; }; "applyTestId": { "alias": "applyTestId"; "required": false; }; "primaryAction": { "alias": "primaryAction"; "required": false; }; "secondaryActions": { "alias": "secondaryActions"; "required": false; }; "governanceActions": { "alias": "governanceActions"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "canSubmit": { "alias": "canSubmit"; "required": false; }; "canApply": { "alias": "canApply"; "required": false; }; "submitOnEnter": { "alias": "submitOnEnter"; "required": false; }; "showAttachAction": { "alias": "showAttachAction"; "required": false; }; "enablePastedAttachments": { "alias": "enablePastedAttachments"; "required": false; }; "enableFileAttachments": { "alias": "enableFileAttachments"; "required": false; }; "attachmentAccept": { "alias": "attachmentAccept"; "required": false; }; "attachmentMultiple": { "alias": "attachmentMultiple"; "required": false; }; "voiceInputMode": { "alias": "voiceInputMode"; "required": false; }; "voiceLanguage": { "alias": "voiceLanguage"; "required": false; }; "draggable": { "alias": "draggable"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "minWidth": { "alias": "minWidth"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; }, { "promptChange": "promptChange"; "submitPrompt": "submitPrompt"; "apply": "apply"; "retryTurn": "retryTurn"; "cancelTurn": "cancelTurn"; "shellAction": "shellAction"; "close": "close"; "attach": "attach"; "attachmentsPasted": "attachmentsPasted"; "attachmentsSelected": "attachmentsSelected"; "removeAttachment": "removeAttachment"; "messageAction": "messageAction"; "editMessage": "editMessage"; "resendMessage": "resendMessage"; "quickReply": "quickReply"; "recommendedIntent": "recommendedIntent"; "layoutChange": "layoutChange"; }, never, never, true, never>;
2469
+ }
2470
+
2471
+ declare const PRAXIS_ASSISTANT_VOICE_INPUT_MODE: InjectionToken<PraxisAssistantVoiceInputMode>;
2472
+ declare const PRAXIS_ASSISTANT_VOICE_LANGUAGE: InjectionToken<string>;
2473
+
2474
+ type PraxisAssistantDockTone = 'ready' | 'working' | 'review' | 'governed' | 'error';
2475
+ declare class PraxisAiAssistantDockComponent {
2476
+ title: string;
2477
+ summary: string;
2478
+ badge: string;
2479
+ icon: string;
2480
+ state: PraxisAssistantShellState | null;
2481
+ tone: PraxisAssistantDockTone | null;
2482
+ ariaLabel: string;
2483
+ openAriaLabel: string;
2484
+ openTooltip: string;
2485
+ testId: string;
2486
+ openTestId: string;
2487
+ open: EventEmitter<void>;
2488
+ resolvedTone(): PraxisAssistantDockTone;
2489
+ resolvedIcon(): string;
2490
+ resolvedBadge(): string;
2491
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantDockComponent, never>;
2492
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisAiAssistantDockComponent, "praxis-ai-assistant-dock", never, { "title": { "alias": "title"; "required": false; }; "summary": { "alias": "summary"; "required": false; }; "badge": { "alias": "badge"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "state": { "alias": "state"; "required": false; }; "tone": { "alias": "tone"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "openAriaLabel": { "alias": "openAriaLabel"; "required": false; }; "openTooltip": { "alias": "openTooltip"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "openTestId": { "alias": "openTestId"; "required": false; }; }, { "open": "open"; }, never, never, true, never>;
2493
+ }
2494
+
2495
+ declare class PraxisAiAssistantSessionHostComponent {
2496
+ private readonly registry;
2497
+ testId: string;
2498
+ dockTestIdPrefix: string;
2499
+ ariaLabel: string;
2500
+ openAriaLabel: string;
2501
+ openTooltip: string;
2502
+ ownerType: string | null;
2503
+ ownerId: string | null;
2504
+ visibility: PraxisAssistantSessionVisibility | 'all';
2505
+ includeOriginAnchored: boolean;
2506
+ sessionOpen: EventEmitter<PraxisAssistantSessionSnapshot>;
2507
+ visibleSessions(): readonly PraxisAssistantSessionSnapshot[];
2508
+ openSession(sessionId: string): void;
2509
+ sessionAriaLabel(session: PraxisAssistantSessionSnapshot): string;
2510
+ dockTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string;
2511
+ dockOpenTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string;
2512
+ trackSession(_index: number, session: PraxisAssistantSessionSnapshot): string;
2513
+ private safeId;
2514
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantSessionHostComponent, never>;
2515
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisAiAssistantSessionHostComponent, "praxis-ai-assistant-session-host", never, { "testId": { "alias": "testId"; "required": false; }; "dockTestIdPrefix": { "alias": "dockTestIdPrefix"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "openAriaLabel": { "alias": "openAriaLabel"; "required": false; }; "openTooltip": { "alias": "openTooltip"; "required": false; }; "ownerType": { "alias": "ownerType"; "required": false; }; "ownerId": { "alias": "ownerId"; "required": false; }; "visibility": { "alias": "visibility"; "required": false; }; "includeOriginAnchored": { "alias": "includeOriginAnchored"; "required": false; }; }, { "sessionOpen": "sessionOpen"; }, never, never, true, never>;
2516
+ static ngAcceptInputType_includeOriginAnchored: unknown;
2517
+ }
2518
+
2519
+ declare class AiContextBuilderService {
2520
+ private schemaMinifier;
2521
+ constructor(schemaMinifier: SchemaMinifierService);
2522
+ /**
2523
+ * Builds the complete context for the AI prompt
2524
+ */
2525
+ buildPromptContext(fieldSchemas: Record<string, FieldSchemaLike>, targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', propertySchema: RulePropertySchema): PromptContext;
2526
+ buildRulePrompt(userPrompt: string, context: PromptContext): string;
2527
+ buildSuggestionPrompt(context: PromptContext): string;
2528
+ /**
2529
+ * Formats available properties by targetType
2530
+ */
2531
+ private formatProperties;
2532
+ /**
2533
+ * Lists JSON Logic operators with examples
2534
+ */
2535
+ private formatOperators;
2536
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiContextBuilderService, never>;
2537
+ static ɵprov: i0.ɵɵInjectableDeclaration<AiContextBuilderService>;
2538
+ }
2539
+
2540
+ interface AiWizardData {
2541
+ fieldSchemas: Record<string, FieldSchemaLike>;
2542
+ targetSchemas?: any;
2543
+ propertySchema: RulePropertySchema;
2544
+ }
2545
+ type WizardStep = 'prompt' | 'review';
2546
+ declare class AiRuleWizardDialogComponent implements OnInit {
2547
+ dialogRef: MatDialogRef<AiRuleWizardDialogComponent>;
2548
+ data: AiWizardData;
2549
+ private aiService;
2550
+ private validator;
2551
+ private snackBar;
2552
+ private contextBuilder;
2553
+ private cdr;
2554
+ selectedTargetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock';
2555
+ userPrompt: string;
2556
+ isGenerating: boolean;
2557
+ validationError: string | null;
2558
+ loadingSuggestions: boolean;
2559
+ suggestions: string[];
2560
+ private suggestionsCache;
2561
+ private suggestionsRequestId;
2562
+ currentStep: WizardStep;
2563
+ generatedResponse: AiRuleResponse | null;
2564
+ warnings: AiValidationWarning[];
2565
+ loadingMessages: string[];
2566
+ currentLoadingMessage: string;
2567
+ streamingText: string;
2568
+ private loadingInterval;
2569
+ constructor(dialogRef: MatDialogRef<AiRuleWizardDialogComponent>, data: AiWizardData, aiService: PraxisAiService, validator: AiResponseValidatorService, snackBar: MatSnackBar, contextBuilder: AiContextBuilderService, cdr: ChangeDetectorRef);
2570
+ ngOnInit(): void;
2571
+ onTargetTypeChange(): void;
2572
+ getAvailableProperties(): _praxisui_ai.RulePropertyDefinition[];
2573
+ loadSuggestions(forceRefresh?: boolean): Promise<void>;
2574
+ reloadSuggestions(): void;
2575
+ applySuggestion(text: string): void;
2576
+ generate(): Promise<void>;
2577
+ private startLoadingUX;
2578
+ private stopLoadingUX;
2579
+ backToPrompt(): void;
2580
+ confirm(): void;
2581
+ getProps(obj: any): {
2582
+ key: string;
2583
+ value: any;
2584
+ }[];
2585
+ hasProps(obj: any): boolean;
2586
+ static ɵfac: i0.ɵɵFactoryDeclaration<AiRuleWizardDialogComponent, never>;
2587
+ static ɵcmp: i0.ɵɵComponentDeclaration<AiRuleWizardDialogComponent, "praxis-ai-rule-wizard-dialog", never, {}, {}, never, never, true, never>;
2588
+ }
2589
+
2590
+ 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, 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, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantDockComponent, PraxisAiAssistantSessionHostComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, SchemaMinifierService, createComponentAuthoringContext, createPraxisAssistantViewportLayout, normalizeAuthoringPrompt, normalizePraxisAssistantAttachmentSummary, normalizePraxisAssistantContextSnapshot, sanitizePraxisAssistantText, shouldRoutePromptToGovernedDecision, submitPraxisAssistantQuickReply, toAiJsonObject, toPraxisAssistantClarificationOption, toPraxisAssistantConversationMessages };
2591
+ export type { AgenticAuthoringApplyRequestContract, AgenticAuthoringApplyResultContract, AgenticAuthoringAttachmentSummaryContract, AgenticAuthoringCandidateContract, AgenticAuthoringComponentCapabilitiesResultContract, AgenticAuthoringComponentCapabilityCatalogContract, AgenticAuthoringComponentCapabilityContract, AgenticAuthoringComponentCapabilityExampleContract, AgenticAuthoringComponentFieldAliasContract, AgenticAuthoringConversationContextContract, AgenticAuthoringConversationMessageContract, AgenticAuthoringIntentResolutionRequestContract, AgenticAuthoringIntentResolutionResultContract, AgenticAuthoringManifestCompileResult, AgenticAuthoringManifestCompileResultContract, AgenticAuthoringManifestEditPlanRequest, AgenticAuthoringManifestEditPlanRequestContract, AgenticAuthoringManifestValidationResult, AgenticAuthoringManifestValidationResultContract, AgenticAuthoringPendingClarificationContract, AgenticAuthoringPlanRequestContract, AgenticAuthoringPreviewResultContract, AgenticAuthoringQuickReplyContract, AgenticAuthoringResolveTargetRequest, AgenticAuthoringResolveTargetRequestContract, AgenticAuthoringResolvedTarget, AgenticAuthoringResolvedTargetContract, AgenticAuthoringResourceCandidatesRequestContract, AgenticAuthoringResourceCandidatesResultContract, AgenticAuthoringSemanticDecisionContract, AgenticAuthoringTurnStreamConnection, AgenticAuthoringTurnStreamEnvelope, AgenticAuthoringTurnStreamEnvelopeContract, AgenticAuthoringTurnStreamRequest, AgenticAuthoringTurnStreamRequestContract, AgenticAuthoringTurnStreamStartResponse, AgenticAuthoringTurnStreamStartResponseContract, AiAssistantObservationFeedbackRating, AiAssistantObservationFeedbackRatingValue, AiAssistantObservationFeedbackRequest, AiAssistantObservationFeedbackRequestContract, AiAssistantObservationFeedbackResponse, AiAssistantObservationFeedbackResponseContract, AiAssistantObservationResponseContract, AiAssistantObservationSummaryResponseContract, AiAssistantObservationSummaryRowContract, 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, ProblemResponseContract, PromptContext, RulePropertyDefinition, RulePropertySchema, RulePropertyType, ValidationContext, ValueKind };