@praxisui/ai 8.0.0-beta.103 → 8.0.0-beta.105
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.
- package/README.md +2 -0
- package/fesm2022/praxisui-ai.mjs +493 -79
- package/package.json +2 -2
- package/types/praxisui-ai.d.ts +81 -9
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/ai",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.105",
|
|
4
4
|
"description": "AI building blocks and assistant integration for Praxis UI applications.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0",
|
|
8
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^8.0.0-beta.105",
|
|
9
9
|
"@angular/cdk": "^21.0.0",
|
|
10
10
|
"@angular/forms": "^21.0.0",
|
|
11
11
|
"@angular/material": "^21.0.0",
|
package/types/praxisui-ai.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, OnDestroy, ElementRef, OnChanges, EventEmitter, SimpleChanges, OnInit, ChangeDetectorRef } from '@angular/core';
|
|
3
3
|
import * as rxjs from 'rxjs';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
+
import { PraxisRuntimeComponentObservationEnvelope, PraxisRuntimeComponentObservationRegistryService } from '@praxisui/core';
|
|
5
6
|
import { Schema } from '@google/generative-ai';
|
|
6
7
|
import { ConnectedPosition, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
7
8
|
import * as _praxisui_ai from '@praxisui/ai';
|
|
@@ -18,7 +19,7 @@ declare class PraxisAi {
|
|
|
18
19
|
* Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js.
|
|
19
20
|
*/
|
|
20
21
|
declare const AI_CONTRACT_VERSION: "v1.1";
|
|
21
|
-
declare const AI_CONTRACT_SCHEMA_HASH: "
|
|
22
|
+
declare const AI_CONTRACT_SCHEMA_HASH: "daab9623a5c4d660105dfe1c85a6bd1ee1ef1b54ef5981e26d27c44aa82ddb4f";
|
|
22
23
|
declare const AI_STREAM_EVENT_SCHEMA_VERSION: "v1";
|
|
23
24
|
declare const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION: "praxis.ai.context-hints.domain-catalog/v0.2";
|
|
24
25
|
declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "result", "error", "cancelled"];
|
|
@@ -281,7 +282,9 @@ interface AgenticAuthoringQuickReplyContract {
|
|
|
281
282
|
icon?: string | null;
|
|
282
283
|
tone?: string | null;
|
|
283
284
|
contextHints?: AiContextHintsContract | null;
|
|
284
|
-
|
|
285
|
+
semanticDecision?: AgenticAuthoringSemanticDecisionContract | null;
|
|
286
|
+
value?: AiJsonObject | AiJsonValue | null;
|
|
287
|
+
[key: string]: AiJsonValue | AiContextHintsContract | AgenticAuthoringSemanticDecisionContract | null | undefined;
|
|
285
288
|
}
|
|
286
289
|
interface AgenticAuthoringSemanticSelectedResourceContract {
|
|
287
290
|
resourcePath?: string | null;
|
|
@@ -442,7 +445,10 @@ interface AgenticAuthoringTurnStreamRequestContract extends AgenticAuthoringConv
|
|
|
442
445
|
contextHints?: AiContextHintsContract | null;
|
|
443
446
|
componentCapabilities?: AgenticAuthoringComponentCapabilitiesResultContract | null;
|
|
444
447
|
activeSemanticDecision?: AgenticAuthoringSemanticDecisionContract | null;
|
|
445
|
-
|
|
448
|
+
diagnostics?: AiJsonObject | null;
|
|
449
|
+
runtimeComponentObservations?: unknown[] | null;
|
|
450
|
+
runtimeComponentObservationTrustBoundary?: 'untrusted_frontend_observation' | null;
|
|
451
|
+
[key: string]: AiJsonValue | AiContextHintsContract | AgenticAuthoringComponentCapabilitiesResultContract | AgenticAuthoringSemanticDecisionContract | AgenticAuthoringConversationMessageContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringAttachmentSummaryContract[] | unknown[] | undefined;
|
|
446
452
|
}
|
|
447
453
|
interface AgenticAuthoringPreviewResultContract {
|
|
448
454
|
valid?: boolean;
|
|
@@ -845,6 +851,7 @@ interface PraxisAssistantShellMessage {
|
|
|
845
851
|
id: string;
|
|
846
852
|
role: PraxisAssistantShellMessageRole;
|
|
847
853
|
text: string;
|
|
854
|
+
assistantContent?: Readonly<Record<string, unknown>> | null;
|
|
848
855
|
status?: 'pending' | 'done' | 'error';
|
|
849
856
|
editable?: boolean;
|
|
850
857
|
resendable?: boolean;
|
|
@@ -1103,6 +1110,7 @@ interface PraxisAssistantClarificationOption {
|
|
|
1103
1110
|
id: string;
|
|
1104
1111
|
label: string;
|
|
1105
1112
|
value: string;
|
|
1113
|
+
rawValue?: unknown;
|
|
1106
1114
|
description?: string;
|
|
1107
1115
|
displayPrompt?: string;
|
|
1108
1116
|
example?: string;
|
|
@@ -1125,6 +1133,7 @@ interface PraxisAssistantTurnAction {
|
|
|
1125
1133
|
value?: unknown;
|
|
1126
1134
|
displayPrompt?: string;
|
|
1127
1135
|
contextHints?: Record<string, unknown>;
|
|
1136
|
+
activeSemanticDecision?: Record<string, unknown>;
|
|
1128
1137
|
}
|
|
1129
1138
|
interface PraxisAssistantPendingClarification {
|
|
1130
1139
|
sourcePrompt: string;
|
|
@@ -1158,16 +1167,19 @@ interface PraxisAssistantTurnRequest {
|
|
|
1158
1167
|
schemaFields?: unknown;
|
|
1159
1168
|
dataProfile?: unknown;
|
|
1160
1169
|
contextHints?: Record<string, unknown>;
|
|
1170
|
+
activeSemanticDecision?: Record<string, unknown>;
|
|
1161
1171
|
preview?: unknown;
|
|
1162
1172
|
pendingPatch?: unknown;
|
|
1163
1173
|
pendingClarification?: PraxisAssistantPendingClarification;
|
|
1164
1174
|
diagnostics?: Record<string, unknown>;
|
|
1165
1175
|
observationId?: string | null;
|
|
1176
|
+
runtimeComponentObservations?: readonly PraxisRuntimeComponentObservationEnvelope[];
|
|
1166
1177
|
}
|
|
1167
1178
|
interface PraxisAssistantTurnResult {
|
|
1168
1179
|
state: PraxisAssistantShellState;
|
|
1169
1180
|
phase?: PraxisAssistantTurnPhase;
|
|
1170
1181
|
assistantMessage?: string;
|
|
1182
|
+
assistantContent?: Readonly<Record<string, unknown>> | null;
|
|
1171
1183
|
messages?: readonly PraxisAssistantShellMessage[];
|
|
1172
1184
|
quickReplies?: readonly PraxisAssistantShellQuickReply[];
|
|
1173
1185
|
clarificationQuestions?: readonly PraxisAssistantClarificationQuestion[];
|
|
@@ -1455,7 +1467,7 @@ declare class PraxisAiService {
|
|
|
1455
1467
|
}
|
|
1456
1468
|
|
|
1457
1469
|
declare const AI_INTENT_CONTRACT_VERSION: "v1.1";
|
|
1458
|
-
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "
|
|
1470
|
+
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "daab9623a5c4d660105dfe1c85a6bd1ee1ef1b54ef5981e26d27c44aa82ddb4f";
|
|
1459
1471
|
type AiSchemaContext = AiSchemaContextContract;
|
|
1460
1472
|
interface AiSuggestionsRequest {
|
|
1461
1473
|
componentId: string;
|
|
@@ -1493,7 +1505,13 @@ type AgenticAuthoringResolveTargetRequest = AgenticAuthoringResolveTargetRequest
|
|
|
1493
1505
|
type AgenticAuthoringResolvedTarget = AgenticAuthoringResolvedTargetContract;
|
|
1494
1506
|
type AgenticAuthoringManifestValidationResult = AgenticAuthoringManifestValidationResultContract;
|
|
1495
1507
|
type AgenticAuthoringManifestCompileResult = AgenticAuthoringManifestCompileResultContract;
|
|
1496
|
-
type
|
|
1508
|
+
type WithoutStringIndex<T> = {
|
|
1509
|
+
[K in keyof T as string extends K ? never : K]: T[K];
|
|
1510
|
+
};
|
|
1511
|
+
type AgenticAuthoringTurnStreamRequest = WithoutStringIndex<AgenticAuthoringTurnStreamRequestContract> & Record<string, unknown> & {
|
|
1512
|
+
runtimeComponentObservations?: readonly PraxisRuntimeComponentObservationEnvelope[] | readonly unknown[] | null;
|
|
1513
|
+
runtimeComponentObservationTrustBoundary?: 'untrusted_frontend_observation' | null;
|
|
1514
|
+
};
|
|
1497
1515
|
type AgenticAuthoringTurnStreamStartResponse = AgenticAuthoringTurnStreamStartResponseContract;
|
|
1498
1516
|
type AgenticAuthoringTurnStreamEnvelope<TPayload extends AiJsonObject = AiJsonObject> = AgenticAuthoringTurnStreamEnvelopeContract<TPayload>;
|
|
1499
1517
|
interface AiPatchStreamConnection {
|
|
@@ -1514,6 +1532,7 @@ interface AgenticAuthoringTurnStreamLifecycle {
|
|
|
1514
1532
|
}
|
|
1515
1533
|
interface AgenticAuthoringTurnStreamConnectionOptions {
|
|
1516
1534
|
baseUrl?: string;
|
|
1535
|
+
headers?: Record<string, string | undefined>;
|
|
1517
1536
|
onLifecycle?: (event: AgenticAuthoringTurnStreamLifecycle) => void;
|
|
1518
1537
|
}
|
|
1519
1538
|
interface AgenticAuthoringTurnStreamStartOptions {
|
|
@@ -1687,6 +1706,8 @@ declare class AiBackendApiService {
|
|
|
1687
1706
|
private consumeBufferedSseFrames;
|
|
1688
1707
|
private findSseFrameBoundary;
|
|
1689
1708
|
private probePatchStreamEndpoint;
|
|
1709
|
+
private buildFetchHeaders;
|
|
1710
|
+
private hasExplicitHeaders;
|
|
1690
1711
|
static ɵfac: i0.ɵɵFactoryDeclaration<AiBackendApiService, never>;
|
|
1691
1712
|
static ɵprov: i0.ɵɵInjectableDeclaration<AiBackendApiService>;
|
|
1692
1713
|
}
|
|
@@ -1717,15 +1738,24 @@ interface AgenticAuthoringTurnLifecycleEvent {
|
|
|
1717
1738
|
type AgenticAuthoringTurnClientEvent = AgenticAuthoringTurnStreamStartedEvent | AgenticAuthoringTurnLifecycleEvent | AgenticAuthoringTurnStreamEnvelopeEvent;
|
|
1718
1739
|
declare class AgenticAuthoringTurnClientService {
|
|
1719
1740
|
private readonly aiApi;
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1741
|
+
private readonly runtimeObservationRegistry;
|
|
1742
|
+
streamEvents(request: AgenticAuthoringTurnStreamRequest, options?: AgenticAuthoringTurnClientOptions): Observable<AgenticAuthoringTurnClientEvent>;
|
|
1743
|
+
streamTurn(request: AgenticAuthoringTurnStreamRequest, options?: AgenticAuthoringTurnClientOptions): Observable<PraxisAssistantTurnResult>;
|
|
1744
|
+
toTurnResult(event: AgenticAuthoringTurnStreamEnvelopeContract, clientTurnId?: string | null): PraxisAssistantTurnResult;
|
|
1745
|
+
private withRuntimeObservationTrustBoundary;
|
|
1746
|
+
private collectRuntimeComponentObservations;
|
|
1747
|
+
private isRuntimeComponentObservationEnvelopeLike;
|
|
1748
|
+
private startAuthoringTurnStream;
|
|
1749
|
+
private isPromiseLike;
|
|
1723
1750
|
private toResultTurn;
|
|
1751
|
+
private isConsultativeCatalogAnswer;
|
|
1724
1752
|
private toShellQuickReplies;
|
|
1725
1753
|
private toPendingClarification;
|
|
1726
1754
|
private phaseForPayload;
|
|
1727
1755
|
private statusForPayload;
|
|
1728
1756
|
private resultDiagnostics;
|
|
1757
|
+
private runtimeRelatedSurfaceDisambiguationContext;
|
|
1758
|
+
private runtimeRelatedSurfaceDisambiguationPageId;
|
|
1729
1759
|
private toLifecycleEvent;
|
|
1730
1760
|
private silenceStatusEvent;
|
|
1731
1761
|
private resultTimeoutEvent;
|
|
@@ -1781,6 +1811,7 @@ interface PraxisAssistantTurnControllerOptions {
|
|
|
1781
1811
|
contextHints?: Record<string, unknown>;
|
|
1782
1812
|
}
|
|
1783
1813
|
declare class PraxisAssistantTurnOrchestratorService {
|
|
1814
|
+
private readonly runtimeObservationRegistry;
|
|
1784
1815
|
createController(flow: PraxisAssistantTurnFlow, options?: PraxisAssistantTurnControllerOptions): PraxisAssistantTurnController;
|
|
1785
1816
|
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAssistantTurnOrchestratorService, never>;
|
|
1786
1817
|
static ɵprov: i0.ɵɵInjectableDeclaration<PraxisAssistantTurnOrchestratorService>;
|
|
@@ -1788,10 +1819,11 @@ declare class PraxisAssistantTurnOrchestratorService {
|
|
|
1788
1819
|
declare class PraxisAssistantTurnController {
|
|
1789
1820
|
private readonly flow;
|
|
1790
1821
|
private readonly options;
|
|
1822
|
+
private readonly runtimeObservationRegistry;
|
|
1791
1823
|
private readonly stateSubject;
|
|
1792
1824
|
readonly state$: Observable<PraxisAssistantTurnViewState>;
|
|
1793
1825
|
private activeFlowClientTurnId;
|
|
1794
|
-
constructor(flow: PraxisAssistantTurnFlow, options: PraxisAssistantTurnControllerOptions);
|
|
1826
|
+
constructor(flow: PraxisAssistantTurnFlow, options: PraxisAssistantTurnControllerOptions, runtimeObservationRegistry: PraxisRuntimeComponentObservationRegistryService | null);
|
|
1795
1827
|
snapshot(): PraxisAssistantTurnViewState;
|
|
1796
1828
|
setContextHints(hints: Record<string, unknown> | undefined): void;
|
|
1797
1829
|
setContextItems(items: readonly PraxisAssistantShellContextItem[]): void;
|
|
@@ -1809,7 +1841,10 @@ declare class PraxisAssistantTurnController {
|
|
|
1809
1841
|
retry(): Observable<PraxisAssistantTurnViewState>;
|
|
1810
1842
|
cancel(): Observable<PraxisAssistantTurnViewState>;
|
|
1811
1843
|
private runFlow;
|
|
1844
|
+
private invokeFlow;
|
|
1812
1845
|
private buildRequest;
|
|
1846
|
+
private collectRuntimeComponentObservations;
|
|
1847
|
+
private isPromiseLike;
|
|
1813
1848
|
private submitExistingUserMessage;
|
|
1814
1849
|
private findUserMessageIndex;
|
|
1815
1850
|
private resetReplayState;
|
|
@@ -2345,6 +2380,21 @@ interface QuickReplyContextChip {
|
|
|
2345
2380
|
value: string;
|
|
2346
2381
|
ariaLabel: string;
|
|
2347
2382
|
}
|
|
2383
|
+
type AssistantContentBlock = Readonly<Record<string, unknown>>;
|
|
2384
|
+
interface AssistantContentResourceField {
|
|
2385
|
+
name: string;
|
|
2386
|
+
label: string;
|
|
2387
|
+
description: string;
|
|
2388
|
+
}
|
|
2389
|
+
interface AssistantContentResource {
|
|
2390
|
+
id: string;
|
|
2391
|
+
label: string;
|
|
2392
|
+
description: string;
|
|
2393
|
+
role: string;
|
|
2394
|
+
resourcePath: string;
|
|
2395
|
+
fields: readonly AssistantContentResourceField[];
|
|
2396
|
+
evidence: readonly string[];
|
|
2397
|
+
}
|
|
2348
2398
|
declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
2349
2399
|
labels: Partial<PraxisAssistantShellLabels> | null;
|
|
2350
2400
|
mode: PraxisAssistantShellMode;
|
|
@@ -2446,6 +2496,20 @@ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
|
2446
2496
|
protected onAttachmentFilesSelected(event: Event): void;
|
|
2447
2497
|
protected onApply(): void;
|
|
2448
2498
|
protected renderMessageText(text: string | null | undefined): string;
|
|
2499
|
+
protected hasStructuredAssistantContent(message: PraxisAssistantShellMessage): boolean;
|
|
2500
|
+
protected getAssistantContentBlocks(message: PraxisAssistantShellMessage): readonly AssistantContentBlock[];
|
|
2501
|
+
protected getAssistantContentBlockType(block: AssistantContentBlock): string;
|
|
2502
|
+
protected getAssistantContentBlockTitle(block: AssistantContentBlock, fallback?: string): string;
|
|
2503
|
+
protected getAssistantContentBlockText(block: AssistantContentBlock): string;
|
|
2504
|
+
protected getAssistantContentResources(block: AssistantContentBlock): readonly AssistantContentResource[];
|
|
2505
|
+
protected getAssistantContentResourceFields(resource: Record<string, unknown>): readonly AssistantContentResourceField[];
|
|
2506
|
+
protected getAssistantContentResourceMeta(resource: AssistantContentResource): readonly string[];
|
|
2507
|
+
protected trackAssistantContentBlock(index: number, block: AssistantContentBlock): string;
|
|
2508
|
+
protected trackAssistantContentResource(index: number, resource: AssistantContentResource): string;
|
|
2509
|
+
protected trackAssistantContentField(index: number, field: AssistantContentResourceField): string;
|
|
2510
|
+
protected trackAssistantContentValue(_index: number, value: string): string;
|
|
2511
|
+
private isSupportedAssistantContentBlock;
|
|
2512
|
+
private getStringArray;
|
|
2449
2513
|
private renderInlineMarkdown;
|
|
2450
2514
|
private escapeHtml;
|
|
2451
2515
|
protected shouldShowStatusText(): boolean;
|
|
@@ -2476,6 +2540,7 @@ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
|
2476
2540
|
protected getRecommendedIntentTone(intent: PraxisAssistantRecommendedIntent): string;
|
|
2477
2541
|
protected getRecommendedIntentGroupLabel(intent: PraxisAssistantRecommendedIntent): string;
|
|
2478
2542
|
protected getQuickReplyAriaLabel(reply: PraxisAssistantShellQuickReply): string;
|
|
2543
|
+
protected getQuickReplyLabel(reply: PraxisAssistantShellQuickReply): string;
|
|
2479
2544
|
protected getQuickReplyTechnicalDetails(reply: PraxisAssistantShellQuickReply): string;
|
|
2480
2545
|
protected isRichQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
|
|
2481
2546
|
protected shouldUseInlineQuickReplies(): boolean;
|
|
@@ -2491,9 +2556,12 @@ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
|
2491
2556
|
private asRecord;
|
|
2492
2557
|
private stringHint;
|
|
2493
2558
|
private quickReplyHint;
|
|
2559
|
+
private quickReplyPublicResourceLabel;
|
|
2560
|
+
private isPublicDisplayText;
|
|
2494
2561
|
private hasQuickReplyResourceContext;
|
|
2495
2562
|
private isFieldDiscoveryQuickReply;
|
|
2496
2563
|
protected isContextualPreviewActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
|
|
2564
|
+
protected isSourceReviewQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
|
|
2497
2565
|
protected isGuidedActionQuickReply(reply: PraxisAssistantShellQuickReply): boolean;
|
|
2498
2566
|
private quickReplyPresentation;
|
|
2499
2567
|
private quickReplyPresentationKind;
|
|
@@ -2502,8 +2570,12 @@ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
|
2502
2570
|
private isGenericContextualActionDescription;
|
|
2503
2571
|
private trimSentencePunctuation;
|
|
2504
2572
|
private shortPathLabel;
|
|
2573
|
+
private knownPublicResourceLabel;
|
|
2505
2574
|
private shortTechnicalLabel;
|
|
2575
|
+
private friendlyTechnicalLabel;
|
|
2576
|
+
private normalizePortugueseDisplayText;
|
|
2506
2577
|
protected getCloseIcon(): string;
|
|
2578
|
+
protected getContextItemValue(item: PraxisAssistantShellContextItem): string;
|
|
2507
2579
|
private normalizeShellAction;
|
|
2508
2580
|
protected onRemoveAttachment(attachment: PraxisAssistantShellAttachment): void;
|
|
2509
2581
|
protected onMessageAction(message: PraxisAssistantShellMessage, action: PraxisAssistantShellMessageAction): void;
|