@praxisui/ai 8.0.0-beta.19 → 8.0.0-beta.20
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 +7 -1
- package/fesm2022/praxisui-ai.mjs +385 -20
- package/index.d.ts +107 -7
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Peer dependencies (Angular v20):
|
|
|
61
61
|
## What this package is responsible for
|
|
62
62
|
|
|
63
63
|
- assistant UX surfaces and interaction flow
|
|
64
|
-
- reusable assistant shell primitives such as conversation messages, quick replies, prompt composer, apply actions
|
|
64
|
+
- reusable assistant shell primitives such as conversation messages, quick replies, prompt composer, apply actions, drag/resize chrome and minimized-session dock
|
|
65
65
|
- backend API orchestration for provider catalog, suggestions, and patch generation
|
|
66
66
|
- local lightweight session history with tenant/env/user scoping
|
|
67
67
|
- confirmation and risk policy integration for sensitive changes
|
|
@@ -81,6 +81,12 @@ The shell owns the shared UX primitives:
|
|
|
81
81
|
- mode and state labels for `config`, `agentic-authoring`, `chat`, `diagnostic`, `review` and `inline-help`
|
|
82
82
|
- draggable/resizable panel layout and accessibility labels
|
|
83
83
|
|
|
84
|
+
`PraxisAiAssistantDockComponent` is the companion minimized-session surface for the same assistant identity. Hosts use it when a specialized assistant session remains active but the full shell is minimized. The dock owns the shared visual language for assistant presence, state badges and reopen affordance; hosts still provide the semantic session summary and decide what reopening means.
|
|
85
|
+
|
|
86
|
+
`PraxisAssistantSessionRegistryService` is the canonical in-memory registry for assistant sessions opened by different Praxis components in the same application shell. Component hosts register their active or minimized sessions with stable `ownerId`/`ownerType` metadata so a future global assistant host can present one shared experience while preserving each component's semantic context.
|
|
87
|
+
|
|
88
|
+
`PraxisAiAssistantSessionHostComponent` is the canonical presence host for minimized assistant sessions in an application or page shell. It reads `PraxisAssistantSessionRegistryService`, renders the shared dock for each minimized session, and emits the opened session snapshot after promoting that session to active in the registry. Specialized components still own the full shell events until their authoring action contracts are promoted to shared platform contracts.
|
|
89
|
+
|
|
84
90
|
The shell intentionally does not own component semantics. Specialized flows still own their adapter/service contract:
|
|
85
91
|
- configuration assistants continue to use `AiConfigAdapter`, capabilities, suggestions and patch review
|
|
86
92
|
- Page Builder agentic authoring continues to use `/api/praxis/config/ai/authoring/**`
|
package/fesm2022/praxisui-ai.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, InjectionToken, Optional, Inject, inject, ChangeDetectorRef, ElementRef, ViewChild, Input, ChangeDetectionStrategy, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import { Component, Injectable, InjectionToken, Optional, Inject, inject, signal, computed, ChangeDetectorRef, ElementRef, ViewChild, Input, ChangeDetectionStrategy, EventEmitter, Output } from '@angular/core';
|
|
3
3
|
import { SchemaType, GoogleGenerativeAI } from '@google/generative-ai';
|
|
4
4
|
import { throwError, from, Observable, of, BehaviorSubject, tap, map as map$1, isObservable, firstValueFrom } from 'rxjs';
|
|
5
5
|
import { map, catchError, filter, take } from 'rxjs/operators';
|
|
@@ -60,14 +60,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
60
60
|
* Models for Praxis AI (Centralized)
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
+
function toPraxisAssistantConversationMessages(messages, limit = 12) {
|
|
64
|
+
return messages
|
|
65
|
+
.filter((message) => !!message.text?.trim() && isPraxisAssistantConversationMessageRole(message.role))
|
|
66
|
+
.slice(-Math.max(0, limit))
|
|
67
|
+
.map((message) => ({
|
|
68
|
+
id: message.id,
|
|
69
|
+
role: toPraxisAssistantConversationMessageRole(message.role),
|
|
70
|
+
text: message.text,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
function isPraxisAssistantConversationMessageRole(role) {
|
|
74
|
+
return role === 'user' || role === 'assistant' || role === 'system' || role === 'status';
|
|
75
|
+
}
|
|
76
|
+
function toPraxisAssistantConversationMessageRole(role) {
|
|
77
|
+
switch (role) {
|
|
78
|
+
case 'user':
|
|
79
|
+
case 'assistant':
|
|
80
|
+
case 'system':
|
|
81
|
+
return role;
|
|
82
|
+
case 'status':
|
|
83
|
+
return 'assistant';
|
|
84
|
+
default:
|
|
85
|
+
return 'assistant';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
63
89
|
/**
|
|
64
90
|
* Generated from praxis-config-starter/docs/ai/contracts/praxis-ai-api-contract-v1.1.openapi.yaml.
|
|
65
91
|
* Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js.
|
|
66
92
|
*/
|
|
67
93
|
const AI_CONTRACT_VERSION = 'v1.1';
|
|
68
|
-
const AI_CONTRACT_SCHEMA_HASH = '
|
|
94
|
+
const AI_CONTRACT_SCHEMA_HASH = '42af43aec91777def176def87d2f41d30c8dbc8abb6c21dc38b5e181a1a51f4f';
|
|
69
95
|
const AI_STREAM_EVENT_SCHEMA_VERSION = 'v1';
|
|
70
|
-
const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION = 'praxis.ai.context-hints.domain-catalog/v0.
|
|
96
|
+
const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION = 'praxis.ai.context-hints.domain-catalog/v0.2';
|
|
71
97
|
const AI_STREAM_EVENT_TYPES = ['status', 'thought.step', 'heartbeat', 'result', 'error', 'cancelled'];
|
|
72
98
|
|
|
73
99
|
/**
|
|
@@ -1646,7 +1672,8 @@ class PraxisAssistantTurnController {
|
|
|
1646
1672
|
if (!handler) {
|
|
1647
1673
|
return of(this.snapshot());
|
|
1648
1674
|
}
|
|
1649
|
-
|
|
1675
|
+
const flowResult = handler.call(this.flow, request);
|
|
1676
|
+
return this.toObservable(flowResult).pipe(tap((result) => this.applyResult(result)), map$1(() => this.snapshot()));
|
|
1650
1677
|
}
|
|
1651
1678
|
buildRequest(partial) {
|
|
1652
1679
|
const current = this.stateSubject.value;
|
|
@@ -1842,6 +1869,95 @@ class PraxisAssistantTurnController {
|
|
|
1842
1869
|
}
|
|
1843
1870
|
}
|
|
1844
1871
|
|
|
1872
|
+
class PraxisAssistantSessionRegistryService {
|
|
1873
|
+
sessionsState = signal([], ...(ngDevMode ? [{ debugName: "sessionsState" }] : []));
|
|
1874
|
+
sessions = this.sessionsState.asReadonly();
|
|
1875
|
+
activeSession = computed(() => this.sessions().find((session) => session.visibility === 'active') ?? null, ...(ngDevMode ? [{ debugName: "activeSession" }] : []));
|
|
1876
|
+
minimizedSessions = computed(() => this.sessions().filter((session) => session.visibility === 'minimized'), ...(ngDevMode ? [{ debugName: "minimizedSessions" }] : []));
|
|
1877
|
+
upsertSession(descriptor) {
|
|
1878
|
+
const normalized = this.normalizeDescriptor(descriptor);
|
|
1879
|
+
const existing = this.sessionsState().find((session) => session.id === normalized.id);
|
|
1880
|
+
const now = normalized.updatedAt || new Date().toISOString();
|
|
1881
|
+
const next = {
|
|
1882
|
+
...existing,
|
|
1883
|
+
id: normalized.id,
|
|
1884
|
+
ownerId: normalized.ownerId,
|
|
1885
|
+
ownerType: normalized.ownerType,
|
|
1886
|
+
title: normalized.title,
|
|
1887
|
+
summary: normalized.summary,
|
|
1888
|
+
mode: normalized.mode,
|
|
1889
|
+
state: normalized.state,
|
|
1890
|
+
visibility: normalized.visibility,
|
|
1891
|
+
contextItems: normalized.contextItems,
|
|
1892
|
+
badge: normalized.badge,
|
|
1893
|
+
icon: normalized.icon,
|
|
1894
|
+
createdAt: existing?.createdAt ?? now,
|
|
1895
|
+
updatedAt: now,
|
|
1896
|
+
};
|
|
1897
|
+
this.sessionsState.update((sessions) => this.sortSessions([
|
|
1898
|
+
...sessions.filter((session) => session.id !== next.id),
|
|
1899
|
+
next,
|
|
1900
|
+
], next.visibility === 'active' ? next.id : null));
|
|
1901
|
+
return next;
|
|
1902
|
+
}
|
|
1903
|
+
openSession(sessionId) {
|
|
1904
|
+
return this.setVisibility(sessionId, 'active');
|
|
1905
|
+
}
|
|
1906
|
+
minimizeSession(sessionId) {
|
|
1907
|
+
return this.setVisibility(sessionId, 'minimized');
|
|
1908
|
+
}
|
|
1909
|
+
removeSession(sessionId) {
|
|
1910
|
+
this.sessionsState.update((sessions) => sessions.filter((session) => session.id !== sessionId));
|
|
1911
|
+
}
|
|
1912
|
+
getSession(sessionId) {
|
|
1913
|
+
return this.sessionsState().find((session) => session.id === sessionId) ?? null;
|
|
1914
|
+
}
|
|
1915
|
+
clear() {
|
|
1916
|
+
this.sessionsState.set([]);
|
|
1917
|
+
}
|
|
1918
|
+
setVisibility(sessionId, visibility) {
|
|
1919
|
+
const session = this.getSession(sessionId);
|
|
1920
|
+
if (!session)
|
|
1921
|
+
return null;
|
|
1922
|
+
return this.upsertSession({ ...session, visibility });
|
|
1923
|
+
}
|
|
1924
|
+
normalizeDescriptor(descriptor) {
|
|
1925
|
+
const id = descriptor.id?.trim();
|
|
1926
|
+
const ownerId = descriptor.ownerId?.trim();
|
|
1927
|
+
const ownerType = descriptor.ownerType?.trim();
|
|
1928
|
+
if (!id || !ownerId || !ownerType) {
|
|
1929
|
+
throw new Error('Praxis assistant sessions require id, ownerId and ownerType.');
|
|
1930
|
+
}
|
|
1931
|
+
return {
|
|
1932
|
+
id,
|
|
1933
|
+
ownerId,
|
|
1934
|
+
ownerType,
|
|
1935
|
+
title: descriptor.title?.trim() || 'Praxis assistant',
|
|
1936
|
+
summary: descriptor.summary?.trim() || '',
|
|
1937
|
+
mode: descriptor.mode || 'chat',
|
|
1938
|
+
state: descriptor.state || 'idle',
|
|
1939
|
+
visibility: descriptor.visibility || 'minimized',
|
|
1940
|
+
contextItems: [...(descriptor.contextItems ?? [])],
|
|
1941
|
+
badge: descriptor.badge?.trim() || '',
|
|
1942
|
+
icon: descriptor.icon?.trim() || '',
|
|
1943
|
+
updatedAt: descriptor.updatedAt?.trim() || null,
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
sortSessions(sessions, activeSessionId) {
|
|
1947
|
+
return sessions
|
|
1948
|
+
.map((session) => activeSessionId && session.id !== activeSessionId
|
|
1949
|
+
? { ...session, visibility: 'minimized' }
|
|
1950
|
+
: session)
|
|
1951
|
+
.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
1952
|
+
}
|
|
1953
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAssistantSessionRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1954
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAssistantSessionRegistryService, providedIn: 'root' });
|
|
1955
|
+
}
|
|
1956
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAssistantSessionRegistryService, decorators: [{
|
|
1957
|
+
type: Injectable,
|
|
1958
|
+
args: [{ providedIn: 'root' }]
|
|
1959
|
+
}] });
|
|
1960
|
+
|
|
1845
1961
|
const HISTORY_INDEX_PREFIX = 'praxis.ai.history.index';
|
|
1846
1962
|
const HISTORY_SESSION_PREFIX = 'praxis.ai.history.session';
|
|
1847
1963
|
const DEFAULT_SESSION_TITLE = 'Nova sessão';
|
|
@@ -5298,27 +5414,18 @@ class PraxisAiAssistantComponent {
|
|
|
5298
5414
|
if (!normalized)
|
|
5299
5415
|
return undefined;
|
|
5300
5416
|
const domainCatalog = this.asRecord(normalized['domainCatalog']);
|
|
5301
|
-
const
|
|
5302
|
-
if (typeof
|
|
5417
|
+
const recommendedAuthoringFlow = domainCatalog?.['recommendedAuthoringFlow'];
|
|
5418
|
+
if (typeof recommendedAuthoringFlow !== 'string' || !recommendedAuthoringFlow.trim()) {
|
|
5303
5419
|
return normalized;
|
|
5304
5420
|
}
|
|
5305
|
-
const
|
|
5421
|
+
const flowId = recommendedAuthoringFlow.trim();
|
|
5306
5422
|
const enriched = this.toAiJsonObject(normalized);
|
|
5307
|
-
enriched['
|
|
5308
|
-
|
|
5309
|
-
source: 'domainCatalog.
|
|
5423
|
+
enriched['authoringFlow'] = this.toAiJsonObject({
|
|
5424
|
+
flowId,
|
|
5425
|
+
source: 'domainCatalog.recommendedAuthoringFlow',
|
|
5310
5426
|
reviewRequired: true,
|
|
5311
5427
|
materializeOnlyAfterReview: true,
|
|
5312
5428
|
});
|
|
5313
|
-
if (operationId === 'rule.visualBlockGuidance.add') {
|
|
5314
|
-
enriched['ruleDraftPolicy'] = this.toAiJsonObject({
|
|
5315
|
-
type: 'visualBlockGuidance',
|
|
5316
|
-
targetType: 'visualBlock',
|
|
5317
|
-
reviewStatus: 'pending',
|
|
5318
|
-
writeOnly: 'formRules',
|
|
5319
|
-
forbiddenPaths: ['formRulesState'],
|
|
5320
|
-
});
|
|
5321
|
-
}
|
|
5322
5429
|
return this.toClarificationContextHints(enriched);
|
|
5323
5430
|
}
|
|
5324
5431
|
setResourcePathHint(resourcePath) {
|
|
@@ -6526,6 +6633,264 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
6526
6633
|
args: ['conversation']
|
|
6527
6634
|
}] } });
|
|
6528
6635
|
|
|
6636
|
+
class PraxisAiAssistantDockComponent {
|
|
6637
|
+
title = 'Praxis copilot active';
|
|
6638
|
+
summary = 'Conversation preserved. Continue where you stopped.';
|
|
6639
|
+
badge = '';
|
|
6640
|
+
icon = '';
|
|
6641
|
+
state = null;
|
|
6642
|
+
tone = null;
|
|
6643
|
+
ariaLabel = '';
|
|
6644
|
+
openAriaLabel = '';
|
|
6645
|
+
openTooltip = '';
|
|
6646
|
+
testId = 'praxis-ai-assistant-dock';
|
|
6647
|
+
openTestId = 'praxis-ai-assistant-dock-open';
|
|
6648
|
+
open = new EventEmitter();
|
|
6649
|
+
resolvedTone() {
|
|
6650
|
+
if (this.tone)
|
|
6651
|
+
return this.tone;
|
|
6652
|
+
if (this.state === 'error')
|
|
6653
|
+
return 'error';
|
|
6654
|
+
if (this.state === 'processing' || this.state === 'applying')
|
|
6655
|
+
return 'working';
|
|
6656
|
+
if (this.state === 'review')
|
|
6657
|
+
return 'review';
|
|
6658
|
+
if (this.state === 'clarification')
|
|
6659
|
+
return 'governed';
|
|
6660
|
+
return 'ready';
|
|
6661
|
+
}
|
|
6662
|
+
resolvedIcon() {
|
|
6663
|
+
if (this.icon)
|
|
6664
|
+
return this.icon;
|
|
6665
|
+
const tone = this.resolvedTone();
|
|
6666
|
+
if (tone === 'error')
|
|
6667
|
+
return 'error';
|
|
6668
|
+
if (tone === 'working')
|
|
6669
|
+
return 'sync';
|
|
6670
|
+
if (tone === 'review')
|
|
6671
|
+
return 'rate_review';
|
|
6672
|
+
if (tone === 'governed')
|
|
6673
|
+
return 'rule';
|
|
6674
|
+
return 'auto_awesome';
|
|
6675
|
+
}
|
|
6676
|
+
resolvedBadge() {
|
|
6677
|
+
if (this.badge)
|
|
6678
|
+
return this.badge;
|
|
6679
|
+
const tone = this.resolvedTone();
|
|
6680
|
+
if (tone === 'error')
|
|
6681
|
+
return 'Attention';
|
|
6682
|
+
if (tone === 'working')
|
|
6683
|
+
return 'Working';
|
|
6684
|
+
if (tone === 'review')
|
|
6685
|
+
return 'Review';
|
|
6686
|
+
if (tone === 'governed')
|
|
6687
|
+
return 'Governed';
|
|
6688
|
+
return 'Ready';
|
|
6689
|
+
}
|
|
6690
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAiAssistantDockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6691
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: PraxisAiAssistantDockComponent, isStandalone: true, selector: "praxis-ai-assistant-dock", inputs: { title: "title", summary: "summary", badge: "badge", icon: "icon", state: "state", tone: "tone", ariaLabel: "ariaLabel", openAriaLabel: "openAriaLabel", openTooltip: "openTooltip", testId: "testId", openTestId: "openTestId" }, outputs: { open: "open" }, ngImport: i0, template: `
|
|
6692
|
+
<section
|
|
6693
|
+
class="praxis-ai-assistant-dock"
|
|
6694
|
+
[class.praxis-ai-assistant-dock--working]="resolvedTone() === 'working'"
|
|
6695
|
+
[class.praxis-ai-assistant-dock--review]="resolvedTone() === 'review'"
|
|
6696
|
+
[class.praxis-ai-assistant-dock--governed]="resolvedTone() === 'governed'"
|
|
6697
|
+
[class.praxis-ai-assistant-dock--error]="resolvedTone() === 'error'"
|
|
6698
|
+
[attr.data-testid]="testId"
|
|
6699
|
+
role="status"
|
|
6700
|
+
[attr.aria-label]="ariaLabel || title"
|
|
6701
|
+
>
|
|
6702
|
+
<button
|
|
6703
|
+
class="praxis-ai-assistant-dock__main"
|
|
6704
|
+
type="button"
|
|
6705
|
+
[attr.data-testid]="openTestId"
|
|
6706
|
+
[attr.aria-label]="openAriaLabel || title"
|
|
6707
|
+
[matTooltip]="openTooltip || title"
|
|
6708
|
+
(click)="open.emit()"
|
|
6709
|
+
>
|
|
6710
|
+
<span class="praxis-ai-assistant-dock__orb" aria-hidden="true">
|
|
6711
|
+
<mat-icon>{{ resolvedIcon() }}</mat-icon>
|
|
6712
|
+
</span>
|
|
6713
|
+
<span class="praxis-ai-assistant-dock__copy">
|
|
6714
|
+
<strong>{{ title }}</strong>
|
|
6715
|
+
<span>{{ summary }}</span>
|
|
6716
|
+
</span>
|
|
6717
|
+
<span class="praxis-ai-assistant-dock__badge">{{ resolvedBadge() }}</span>
|
|
6718
|
+
</button>
|
|
6719
|
+
</section>
|
|
6720
|
+
`, isInline: true, styles: [":host{display:block;position:var(--praxis-ai-assistant-dock-position, absolute);z-index:var(--praxis-ai-assistant-dock-z-index, 135);right:var(--praxis-ai-assistant-dock-right, 16px);bottom:var(--praxis-ai-assistant-dock-bottom, 88px);width:min(var(--praxis-ai-assistant-dock-width, 560px),calc(100% - 32px));pointer-events:auto}.praxis-ai-assistant-dock__main{appearance:none;width:100%;min-height:76px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(56,189,248,.34);border-radius:18px;background:radial-gradient(circle at 8% 18%,rgba(14,165,233,.24),transparent 34%),linear-gradient(135deg,#0f172af0,#1e293beb 48%,#082f49e6);color:#e0f2fe;box-shadow:0 22px 58px #02061757,inset 0 1px #ffffff1f;cursor:pointer;text-align:left}.praxis-ai-assistant-dock__main:hover,.praxis-ai-assistant-dock__main:focus-visible{border-color:#7dd3fc9e;box-shadow:0 26px 72px #0206176b,0 0 0 3px #0ea5e92e;outline:none}.praxis-ai-assistant-dock__orb{width:46px;height:46px;display:inline-grid;place-items:center;border-radius:16px;background:linear-gradient(135deg,#38bdf8,#22c55e);color:#082f49;box-shadow:0 12px 28px #22c55e3d}.praxis-ai-assistant-dock--working .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#38bdf8,#a78bfa)}.praxis-ai-assistant-dock--review .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#facc15,#38bdf8)}.praxis-ai-assistant-dock--governed .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#22c55e,#14b8a6)}.praxis-ai-assistant-dock--error .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#f97316,#ef4444);color:#fff7ed}.praxis-ai-assistant-dock__copy{min-width:0;display:grid;gap:3px}.praxis-ai-assistant-dock__copy strong{color:#f8fafc;font-size:14px;line-height:1.2}.praxis-ai-assistant-dock__copy span{color:#bae6fd;font-size:12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.praxis-ai-assistant-dock__badge{max-width:132px;padding:5px 9px;border:1px solid rgba(186,230,253,.24);border-radius:999px;background:#0f172a7a;color:#f0f9ff;font-size:11px;font-weight:800;letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}@media(max-width:720px){:host{right:var(--praxis-ai-assistant-dock-mobile-right, 12px);bottom:var(--praxis-ai-assistant-dock-mobile-bottom, 84px);width:calc(100% - 24px)}.praxis-ai-assistant-dock__main{grid-template-columns:auto minmax(0,1fr)}.praxis-ai-assistant-dock__badge{grid-column:2;justify-self:start}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6721
|
+
}
|
|
6722
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAiAssistantDockComponent, decorators: [{
|
|
6723
|
+
type: Component,
|
|
6724
|
+
args: [{ selector: 'praxis-ai-assistant-dock', standalone: true, imports: [CommonModule, MatIconModule, MatTooltipModule], template: `
|
|
6725
|
+
<section
|
|
6726
|
+
class="praxis-ai-assistant-dock"
|
|
6727
|
+
[class.praxis-ai-assistant-dock--working]="resolvedTone() === 'working'"
|
|
6728
|
+
[class.praxis-ai-assistant-dock--review]="resolvedTone() === 'review'"
|
|
6729
|
+
[class.praxis-ai-assistant-dock--governed]="resolvedTone() === 'governed'"
|
|
6730
|
+
[class.praxis-ai-assistant-dock--error]="resolvedTone() === 'error'"
|
|
6731
|
+
[attr.data-testid]="testId"
|
|
6732
|
+
role="status"
|
|
6733
|
+
[attr.aria-label]="ariaLabel || title"
|
|
6734
|
+
>
|
|
6735
|
+
<button
|
|
6736
|
+
class="praxis-ai-assistant-dock__main"
|
|
6737
|
+
type="button"
|
|
6738
|
+
[attr.data-testid]="openTestId"
|
|
6739
|
+
[attr.aria-label]="openAriaLabel || title"
|
|
6740
|
+
[matTooltip]="openTooltip || title"
|
|
6741
|
+
(click)="open.emit()"
|
|
6742
|
+
>
|
|
6743
|
+
<span class="praxis-ai-assistant-dock__orb" aria-hidden="true">
|
|
6744
|
+
<mat-icon>{{ resolvedIcon() }}</mat-icon>
|
|
6745
|
+
</span>
|
|
6746
|
+
<span class="praxis-ai-assistant-dock__copy">
|
|
6747
|
+
<strong>{{ title }}</strong>
|
|
6748
|
+
<span>{{ summary }}</span>
|
|
6749
|
+
</span>
|
|
6750
|
+
<span class="praxis-ai-assistant-dock__badge">{{ resolvedBadge() }}</span>
|
|
6751
|
+
</button>
|
|
6752
|
+
</section>
|
|
6753
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;position:var(--praxis-ai-assistant-dock-position, absolute);z-index:var(--praxis-ai-assistant-dock-z-index, 135);right:var(--praxis-ai-assistant-dock-right, 16px);bottom:var(--praxis-ai-assistant-dock-bottom, 88px);width:min(var(--praxis-ai-assistant-dock-width, 560px),calc(100% - 32px));pointer-events:auto}.praxis-ai-assistant-dock__main{appearance:none;width:100%;min-height:76px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(56,189,248,.34);border-radius:18px;background:radial-gradient(circle at 8% 18%,rgba(14,165,233,.24),transparent 34%),linear-gradient(135deg,#0f172af0,#1e293beb 48%,#082f49e6);color:#e0f2fe;box-shadow:0 22px 58px #02061757,inset 0 1px #ffffff1f;cursor:pointer;text-align:left}.praxis-ai-assistant-dock__main:hover,.praxis-ai-assistant-dock__main:focus-visible{border-color:#7dd3fc9e;box-shadow:0 26px 72px #0206176b,0 0 0 3px #0ea5e92e;outline:none}.praxis-ai-assistant-dock__orb{width:46px;height:46px;display:inline-grid;place-items:center;border-radius:16px;background:linear-gradient(135deg,#38bdf8,#22c55e);color:#082f49;box-shadow:0 12px 28px #22c55e3d}.praxis-ai-assistant-dock--working .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#38bdf8,#a78bfa)}.praxis-ai-assistant-dock--review .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#facc15,#38bdf8)}.praxis-ai-assistant-dock--governed .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#22c55e,#14b8a6)}.praxis-ai-assistant-dock--error .praxis-ai-assistant-dock__orb{background:linear-gradient(135deg,#f97316,#ef4444);color:#fff7ed}.praxis-ai-assistant-dock__copy{min-width:0;display:grid;gap:3px}.praxis-ai-assistant-dock__copy strong{color:#f8fafc;font-size:14px;line-height:1.2}.praxis-ai-assistant-dock__copy span{color:#bae6fd;font-size:12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.praxis-ai-assistant-dock__badge{max-width:132px;padding:5px 9px;border:1px solid rgba(186,230,253,.24);border-radius:999px;background:#0f172a7a;color:#f0f9ff;font-size:11px;font-weight:800;letter-spacing:.02em;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}@media(max-width:720px){:host{right:var(--praxis-ai-assistant-dock-mobile-right, 12px);bottom:var(--praxis-ai-assistant-dock-mobile-bottom, 84px);width:calc(100% - 24px)}.praxis-ai-assistant-dock__main{grid-template-columns:auto minmax(0,1fr)}.praxis-ai-assistant-dock__badge{grid-column:2;justify-self:start}}\n"] }]
|
|
6754
|
+
}], propDecorators: { title: [{
|
|
6755
|
+
type: Input
|
|
6756
|
+
}], summary: [{
|
|
6757
|
+
type: Input
|
|
6758
|
+
}], badge: [{
|
|
6759
|
+
type: Input
|
|
6760
|
+
}], icon: [{
|
|
6761
|
+
type: Input
|
|
6762
|
+
}], state: [{
|
|
6763
|
+
type: Input
|
|
6764
|
+
}], tone: [{
|
|
6765
|
+
type: Input
|
|
6766
|
+
}], ariaLabel: [{
|
|
6767
|
+
type: Input
|
|
6768
|
+
}], openAriaLabel: [{
|
|
6769
|
+
type: Input
|
|
6770
|
+
}], openTooltip: [{
|
|
6771
|
+
type: Input
|
|
6772
|
+
}], testId: [{
|
|
6773
|
+
type: Input
|
|
6774
|
+
}], openTestId: [{
|
|
6775
|
+
type: Input
|
|
6776
|
+
}], open: [{
|
|
6777
|
+
type: Output
|
|
6778
|
+
}] } });
|
|
6779
|
+
|
|
6780
|
+
class PraxisAiAssistantSessionHostComponent {
|
|
6781
|
+
registry = inject(PraxisAssistantSessionRegistryService);
|
|
6782
|
+
testId = 'praxis-ai-assistant-session-host';
|
|
6783
|
+
dockTestIdPrefix = 'praxis-ai-assistant-session';
|
|
6784
|
+
ariaLabel = 'Active Praxis assistant sessions';
|
|
6785
|
+
openAriaLabel = 'Open assistant session';
|
|
6786
|
+
openTooltip = 'Open assistant session';
|
|
6787
|
+
ownerType = null;
|
|
6788
|
+
ownerId = null;
|
|
6789
|
+
visibility = 'minimized';
|
|
6790
|
+
sessionOpen = new EventEmitter();
|
|
6791
|
+
visibleSessions() {
|
|
6792
|
+
return this.registry.sessions().filter((session) => {
|
|
6793
|
+
if (this.visibility !== 'all' && session.visibility !== this.visibility)
|
|
6794
|
+
return false;
|
|
6795
|
+
if (this.ownerType && session.ownerType !== this.ownerType)
|
|
6796
|
+
return false;
|
|
6797
|
+
if (this.ownerId && session.ownerId !== this.ownerId)
|
|
6798
|
+
return false;
|
|
6799
|
+
return true;
|
|
6800
|
+
});
|
|
6801
|
+
}
|
|
6802
|
+
openSession(sessionId) {
|
|
6803
|
+
const session = this.registry.openSession(sessionId);
|
|
6804
|
+
if (session) {
|
|
6805
|
+
this.sessionOpen.emit(session);
|
|
6806
|
+
}
|
|
6807
|
+
}
|
|
6808
|
+
sessionAriaLabel(session) {
|
|
6809
|
+
const summary = session.summary ? `: ${session.summary}` : '';
|
|
6810
|
+
return `${session.title}${summary}`;
|
|
6811
|
+
}
|
|
6812
|
+
dockTestId(session, first) {
|
|
6813
|
+
return first ? `${this.dockTestIdPrefix}-dock` : `${this.dockTestIdPrefix}-dock-${this.safeId(session.id)}`;
|
|
6814
|
+
}
|
|
6815
|
+
dockOpenTestId(session, first) {
|
|
6816
|
+
return first ? `${this.dockTestIdPrefix}-dock-open` : `${this.dockTestIdPrefix}-dock-open-${this.safeId(session.id)}`;
|
|
6817
|
+
}
|
|
6818
|
+
trackSession(_index, session) {
|
|
6819
|
+
return session.id;
|
|
6820
|
+
}
|
|
6821
|
+
safeId(value) {
|
|
6822
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, '-');
|
|
6823
|
+
}
|
|
6824
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAiAssistantSessionHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6825
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: PraxisAiAssistantSessionHostComponent, isStandalone: true, selector: "praxis-ai-assistant-session-host", inputs: { testId: "testId", dockTestIdPrefix: "dockTestIdPrefix", ariaLabel: "ariaLabel", openAriaLabel: "openAriaLabel", openTooltip: "openTooltip", ownerType: "ownerType", ownerId: "ownerId", visibility: "visibility" }, outputs: { sessionOpen: "sessionOpen" }, ngImport: i0, template: `
|
|
6826
|
+
<section
|
|
6827
|
+
*ngIf="visibleSessions().length"
|
|
6828
|
+
class="praxis-ai-assistant-session-host"
|
|
6829
|
+
[attr.data-testid]="testId"
|
|
6830
|
+
[attr.aria-label]="ariaLabel"
|
|
6831
|
+
>
|
|
6832
|
+
<praxis-ai-assistant-dock
|
|
6833
|
+
*ngFor="let session of visibleSessions(); let first = first; trackBy: trackSession"
|
|
6834
|
+
[title]="session.title"
|
|
6835
|
+
[summary]="session.summary"
|
|
6836
|
+
[badge]="session.badge"
|
|
6837
|
+
[icon]="session.icon"
|
|
6838
|
+
[state]="session.state"
|
|
6839
|
+
[ariaLabel]="sessionAriaLabel(session)"
|
|
6840
|
+
[openAriaLabel]="openAriaLabel"
|
|
6841
|
+
[openTooltip]="openTooltip"
|
|
6842
|
+
[testId]="dockTestId(session, first)"
|
|
6843
|
+
[openTestId]="dockOpenTestId(session, first)"
|
|
6844
|
+
(open)="openSession(session.id)"
|
|
6845
|
+
/>
|
|
6846
|
+
</section>
|
|
6847
|
+
`, isInline: true, styles: [":host{display:block;position:absolute;z-index:var(--praxis-ai-assistant-session-host-z-index, 136);right:var(--praxis-ai-assistant-session-host-right, 16px);bottom:var(--praxis-ai-assistant-session-host-bottom, 88px);width:min(var(--praxis-ai-assistant-session-host-width, 560px),calc(100% - 32px));pointer-events:none}.praxis-ai-assistant-session-host{display:grid;gap:10px;pointer-events:auto}praxis-ai-assistant-dock{--praxis-ai-assistant-dock-position: static;--praxis-ai-assistant-dock-width: 100%}@media(max-width:720px){:host{right:var(--praxis-ai-assistant-session-host-mobile-right, 12px);bottom:var(--praxis-ai-assistant-session-host-mobile-bottom, 84px);width:calc(100% - 24px)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PraxisAiAssistantDockComponent, selector: "praxis-ai-assistant-dock", inputs: ["title", "summary", "badge", "icon", "state", "tone", "ariaLabel", "openAriaLabel", "openTooltip", "testId", "openTestId"], outputs: ["open"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6848
|
+
}
|
|
6849
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisAiAssistantSessionHostComponent, decorators: [{
|
|
6850
|
+
type: Component,
|
|
6851
|
+
args: [{ selector: 'praxis-ai-assistant-session-host', standalone: true, imports: [CommonModule, PraxisAiAssistantDockComponent], template: `
|
|
6852
|
+
<section
|
|
6853
|
+
*ngIf="visibleSessions().length"
|
|
6854
|
+
class="praxis-ai-assistant-session-host"
|
|
6855
|
+
[attr.data-testid]="testId"
|
|
6856
|
+
[attr.aria-label]="ariaLabel"
|
|
6857
|
+
>
|
|
6858
|
+
<praxis-ai-assistant-dock
|
|
6859
|
+
*ngFor="let session of visibleSessions(); let first = first; trackBy: trackSession"
|
|
6860
|
+
[title]="session.title"
|
|
6861
|
+
[summary]="session.summary"
|
|
6862
|
+
[badge]="session.badge"
|
|
6863
|
+
[icon]="session.icon"
|
|
6864
|
+
[state]="session.state"
|
|
6865
|
+
[ariaLabel]="sessionAriaLabel(session)"
|
|
6866
|
+
[openAriaLabel]="openAriaLabel"
|
|
6867
|
+
[openTooltip]="openTooltip"
|
|
6868
|
+
[testId]="dockTestId(session, first)"
|
|
6869
|
+
[openTestId]="dockOpenTestId(session, first)"
|
|
6870
|
+
(open)="openSession(session.id)"
|
|
6871
|
+
/>
|
|
6872
|
+
</section>
|
|
6873
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;position:absolute;z-index:var(--praxis-ai-assistant-session-host-z-index, 136);right:var(--praxis-ai-assistant-session-host-right, 16px);bottom:var(--praxis-ai-assistant-session-host-bottom, 88px);width:min(var(--praxis-ai-assistant-session-host-width, 560px),calc(100% - 32px));pointer-events:none}.praxis-ai-assistant-session-host{display:grid;gap:10px;pointer-events:auto}praxis-ai-assistant-dock{--praxis-ai-assistant-dock-position: static;--praxis-ai-assistant-dock-width: 100%}@media(max-width:720px){:host{right:var(--praxis-ai-assistant-session-host-mobile-right, 12px);bottom:var(--praxis-ai-assistant-session-host-mobile-bottom, 84px);width:calc(100% - 24px)}}\n"] }]
|
|
6874
|
+
}], propDecorators: { testId: [{
|
|
6875
|
+
type: Input
|
|
6876
|
+
}], dockTestIdPrefix: [{
|
|
6877
|
+
type: Input
|
|
6878
|
+
}], ariaLabel: [{
|
|
6879
|
+
type: Input
|
|
6880
|
+
}], openAriaLabel: [{
|
|
6881
|
+
type: Input
|
|
6882
|
+
}], openTooltip: [{
|
|
6883
|
+
type: Input
|
|
6884
|
+
}], ownerType: [{
|
|
6885
|
+
type: Input
|
|
6886
|
+
}], ownerId: [{
|
|
6887
|
+
type: Input
|
|
6888
|
+
}], visibility: [{
|
|
6889
|
+
type: Input
|
|
6890
|
+
}], sessionOpen: [{
|
|
6891
|
+
type: Output
|
|
6892
|
+
}] } });
|
|
6893
|
+
|
|
6529
6894
|
class StreamingFeedbackComponent {
|
|
6530
6895
|
title = 'Processando...';
|
|
6531
6896
|
displayText = '';
|
|
@@ -7323,4 +7688,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
7323
7688
|
* Generated bundle index. Do not edit.
|
|
7324
7689
|
*/
|
|
7325
7690
|
|
|
7326
|
-
export { AI_BACKEND_CONFIG_STORE, 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, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, SchemaMinifierService };
|
|
7691
|
+
export { AI_BACKEND_CONFIG_STORE, 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, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantDockComponent, PraxisAiAssistantSessionHostComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, SchemaMinifierService, toPraxisAssistantConversationMessages };
|
package/index.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ declare class PraxisAi {
|
|
|
18
18
|
* Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js.
|
|
19
19
|
*/
|
|
20
20
|
declare const AI_CONTRACT_VERSION: "v1.1";
|
|
21
|
-
declare const AI_CONTRACT_SCHEMA_HASH: "
|
|
21
|
+
declare const AI_CONTRACT_SCHEMA_HASH: "42af43aec91777def176def87d2f41d30c8dbc8abb6c21dc38b5e181a1a51f4f";
|
|
22
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.
|
|
23
|
+
declare const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION: "praxis.ai.context-hints.domain-catalog/v0.2";
|
|
24
24
|
declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "result", "error", "cancelled"];
|
|
25
25
|
type AiJsonPrimitive = string | number | boolean | null;
|
|
26
26
|
type AiJsonArray = AiJsonValue[];
|
|
@@ -30,7 +30,8 @@ interface AiJsonObject {
|
|
|
30
30
|
type AiJsonValue = AiJsonPrimitive | AiJsonObject | AiJsonArray;
|
|
31
31
|
type AiDomainCatalogContextHintItemType = 'context' | 'node' | 'edge' | 'binding' | 'evidence' | 'governance' | 'vocabulary' | 'relationship';
|
|
32
32
|
type AiDomainCatalogContextHintIntent = 'authoring' | 'explain' | 'validate' | 'ai-access-control';
|
|
33
|
-
type
|
|
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;
|
|
34
35
|
interface AiDomainCatalogRelationshipHintContract {
|
|
35
36
|
enabled?: boolean;
|
|
36
37
|
federated?: boolean;
|
|
@@ -53,7 +54,8 @@ interface AiDomainCatalogContextHintContract {
|
|
|
53
54
|
query?: string | null;
|
|
54
55
|
contextKey?: string | null;
|
|
55
56
|
nodeType?: string | null;
|
|
56
|
-
|
|
57
|
+
recommendedAuthoringFlow?: AiDomainCatalogRecommendedAuthoringFlow | null;
|
|
58
|
+
recommendedRuleType?: AiDomainCatalogRecommendedRuleType | null;
|
|
57
59
|
limit?: number;
|
|
58
60
|
relationships?: AiDomainCatalogRelationshipHintContract | null;
|
|
59
61
|
}
|
|
@@ -673,6 +675,13 @@ interface PraxisAssistantPendingClarification {
|
|
|
673
675
|
clientTurnId?: string;
|
|
674
676
|
diagnostics?: Record<string, unknown>;
|
|
675
677
|
}
|
|
678
|
+
type PraxisAssistantConversationMessageRole = 'user' | 'assistant' | 'system';
|
|
679
|
+
interface PraxisAssistantConversationMessage {
|
|
680
|
+
id: string;
|
|
681
|
+
role: PraxisAssistantConversationMessageRole;
|
|
682
|
+
text: string;
|
|
683
|
+
}
|
|
684
|
+
declare function toPraxisAssistantConversationMessages(messages: readonly PraxisAssistantShellMessage[], limit?: number): PraxisAssistantConversationMessage[];
|
|
676
685
|
interface PraxisAssistantTurnRequest {
|
|
677
686
|
mode: PraxisAssistantShellMode;
|
|
678
687
|
phase?: PraxisAssistantTurnPhase;
|
|
@@ -941,7 +950,7 @@ declare class PraxisAiService {
|
|
|
941
950
|
}
|
|
942
951
|
|
|
943
952
|
declare const AI_INTENT_CONTRACT_VERSION: "v1.1";
|
|
944
|
-
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "
|
|
953
|
+
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "42af43aec91777def176def87d2f41d30c8dbc8abb6c21dc38b5e181a1a51f4f";
|
|
945
954
|
type AiSchemaContext = AiSchemaContextContract;
|
|
946
955
|
interface AiSuggestionsRequest {
|
|
947
956
|
componentId: string;
|
|
@@ -1207,6 +1216,54 @@ declare class PraxisAssistantTurnController {
|
|
|
1207
1216
|
private toObservable;
|
|
1208
1217
|
}
|
|
1209
1218
|
|
|
1219
|
+
type PraxisAssistantSessionVisibility = 'active' | 'minimized';
|
|
1220
|
+
interface PraxisAssistantSessionDescriptor {
|
|
1221
|
+
id: string;
|
|
1222
|
+
ownerId: string;
|
|
1223
|
+
ownerType: string;
|
|
1224
|
+
title: string;
|
|
1225
|
+
summary?: string | null;
|
|
1226
|
+
mode?: PraxisAssistantShellMode | null;
|
|
1227
|
+
state?: PraxisAssistantShellState | null;
|
|
1228
|
+
visibility?: PraxisAssistantSessionVisibility | null;
|
|
1229
|
+
contextItems?: readonly PraxisAssistantShellContextItem[] | null;
|
|
1230
|
+
badge?: string | null;
|
|
1231
|
+
icon?: string | null;
|
|
1232
|
+
updatedAt?: string | null;
|
|
1233
|
+
}
|
|
1234
|
+
interface PraxisAssistantSessionSnapshot {
|
|
1235
|
+
id: string;
|
|
1236
|
+
ownerId: string;
|
|
1237
|
+
ownerType: string;
|
|
1238
|
+
title: string;
|
|
1239
|
+
summary: string;
|
|
1240
|
+
mode: PraxisAssistantShellMode;
|
|
1241
|
+
state: PraxisAssistantShellState;
|
|
1242
|
+
visibility: PraxisAssistantSessionVisibility;
|
|
1243
|
+
contextItems: readonly PraxisAssistantShellContextItem[];
|
|
1244
|
+
badge: string;
|
|
1245
|
+
icon: string;
|
|
1246
|
+
createdAt: string;
|
|
1247
|
+
updatedAt: string;
|
|
1248
|
+
}
|
|
1249
|
+
declare class PraxisAssistantSessionRegistryService {
|
|
1250
|
+
private readonly sessionsState;
|
|
1251
|
+
readonly sessions: i0.Signal<PraxisAssistantSessionSnapshot[]>;
|
|
1252
|
+
readonly activeSession: i0.Signal<PraxisAssistantSessionSnapshot | null>;
|
|
1253
|
+
readonly minimizedSessions: i0.Signal<PraxisAssistantSessionSnapshot[]>;
|
|
1254
|
+
upsertSession(descriptor: PraxisAssistantSessionDescriptor): PraxisAssistantSessionSnapshot;
|
|
1255
|
+
openSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
|
|
1256
|
+
minimizeSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
|
|
1257
|
+
removeSession(sessionId: string): void;
|
|
1258
|
+
getSession(sessionId: string): PraxisAssistantSessionSnapshot | null;
|
|
1259
|
+
clear(): void;
|
|
1260
|
+
private setVisibility;
|
|
1261
|
+
private normalizeDescriptor;
|
|
1262
|
+
private sortSessions;
|
|
1263
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAssistantSessionRegistryService, never>;
|
|
1264
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PraxisAssistantSessionRegistryService>;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1210
1267
|
type AssistantMessageRole = 'user' | 'assistant' | 'system';
|
|
1211
1268
|
interface AssistantHistoryMessage {
|
|
1212
1269
|
id: string;
|
|
@@ -1732,6 +1789,49 @@ declare class PraxisAiAssistantShellComponent implements OnChanges, OnDestroy {
|
|
|
1732
1789
|
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; }; "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; }; "busy": { "alias": "busy"; "required": false; }; "canSubmit": { "alias": "canSubmit"; "required": false; }; "canApply": { "alias": "canApply"; "required": false; }; "submitOnEnter": { "alias": "submitOnEnter"; "required": false; }; "enableFileAttachments": { "alias": "enableFileAttachments"; "required": false; }; "attachmentAccept": { "alias": "attachmentAccept"; "required": false; }; "attachmentMultiple": { "alias": "attachmentMultiple"; "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"; "close": "close"; "attach": "attach"; "attachmentsPasted": "attachmentsPasted"; "attachmentsSelected": "attachmentsSelected"; "removeAttachment": "removeAttachment"; "messageAction": "messageAction"; "editMessage": "editMessage"; "resendMessage": "resendMessage"; "quickReply": "quickReply"; "layoutChange": "layoutChange"; }, never, never, true, never>;
|
|
1733
1790
|
}
|
|
1734
1791
|
|
|
1792
|
+
type PraxisAssistantDockTone = 'ready' | 'working' | 'review' | 'governed' | 'error';
|
|
1793
|
+
declare class PraxisAiAssistantDockComponent {
|
|
1794
|
+
title: string;
|
|
1795
|
+
summary: string;
|
|
1796
|
+
badge: string;
|
|
1797
|
+
icon: string;
|
|
1798
|
+
state: PraxisAssistantShellState | null;
|
|
1799
|
+
tone: PraxisAssistantDockTone | null;
|
|
1800
|
+
ariaLabel: string;
|
|
1801
|
+
openAriaLabel: string;
|
|
1802
|
+
openTooltip: string;
|
|
1803
|
+
testId: string;
|
|
1804
|
+
openTestId: string;
|
|
1805
|
+
open: EventEmitter<void>;
|
|
1806
|
+
resolvedTone(): PraxisAssistantDockTone;
|
|
1807
|
+
resolvedIcon(): string;
|
|
1808
|
+
resolvedBadge(): string;
|
|
1809
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantDockComponent, never>;
|
|
1810
|
+
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>;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
declare class PraxisAiAssistantSessionHostComponent {
|
|
1814
|
+
private readonly registry;
|
|
1815
|
+
testId: string;
|
|
1816
|
+
dockTestIdPrefix: string;
|
|
1817
|
+
ariaLabel: string;
|
|
1818
|
+
openAriaLabel: string;
|
|
1819
|
+
openTooltip: string;
|
|
1820
|
+
ownerType: string | null;
|
|
1821
|
+
ownerId: string | null;
|
|
1822
|
+
visibility: PraxisAssistantSessionVisibility | 'all';
|
|
1823
|
+
sessionOpen: EventEmitter<PraxisAssistantSessionSnapshot>;
|
|
1824
|
+
visibleSessions(): readonly PraxisAssistantSessionSnapshot[];
|
|
1825
|
+
openSession(sessionId: string): void;
|
|
1826
|
+
sessionAriaLabel(session: PraxisAssistantSessionSnapshot): string;
|
|
1827
|
+
dockTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string;
|
|
1828
|
+
dockOpenTestId(session: PraxisAssistantSessionSnapshot, first: boolean): string;
|
|
1829
|
+
trackSession(_index: number, session: PraxisAssistantSessionSnapshot): string;
|
|
1830
|
+
private safeId;
|
|
1831
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PraxisAiAssistantSessionHostComponent, never>;
|
|
1832
|
+
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; }; }, { "sessionOpen": "sessionOpen"; }, never, never, true, never>;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1735
1835
|
declare class AiContextBuilderService {
|
|
1736
1836
|
private schemaMinifier;
|
|
1737
1837
|
constructor(schemaMinifier: SchemaMinifierService);
|
|
@@ -1803,5 +1903,5 @@ declare class AiRuleWizardDialogComponent implements OnInit {
|
|
|
1803
1903
|
static ɵcmp: i0.ɵɵComponentDeclaration<AiRuleWizardDialogComponent, "praxis-ai-rule-wizard-dialog", never, {}, {}, never, never, true, never>;
|
|
1804
1904
|
}
|
|
1805
1905
|
|
|
1806
|
-
export { AI_BACKEND_CONFIG_STORE, 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, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, SchemaMinifierService };
|
|
1807
|
-
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, AgenticAuthoringTurnStreamConnection, AgenticAuthoringTurnStreamEnvelope, AgenticAuthoringTurnStreamEnvelopeContract, AgenticAuthoringTurnStreamRequest, AgenticAuthoringTurnStreamRequestContract, AgenticAuthoringTurnStreamStartResponse, AgenticAuthoringTurnStreamStartResponseContract, AiBackendConfigStore, AiBackendStorageOptions, AiChatMessage, AiChatMessageContract, AiClarificationUiContract, AiConfigAdapter, AiContextDTO, AiContextHintsContract, AiContextTemplate, AiContextTemplateMeta, AiCurrentStateDigest, AiCurrentStateDigestContract, AiDomainCatalogContextHintContract, AiDomainCatalogContextHintIntent, AiDomainCatalogContextHintItemType, AiDomainCatalogRelationshipHintContract, AiExamplePair, AiGlobalConfigSnapshot, 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, PraxisAssistantClarificationOption, PraxisAssistantClarificationQuestion, PraxisAssistantClarificationQuestionType, PraxisAssistantPendingClarification, PraxisAssistantShellAttachment, PraxisAssistantShellContextItem, PraxisAssistantShellLabels, PraxisAssistantShellLayout, PraxisAssistantShellMessage, PraxisAssistantShellMessageAction, PraxisAssistantShellMessageRole, PraxisAssistantShellMode, PraxisAssistantShellQuickReply, PraxisAssistantShellState, PraxisAssistantTurnAction, PraxisAssistantTurnControllerOptions, PraxisAssistantTurnFlow, PraxisAssistantTurnPhase, PraxisAssistantTurnRequest, PraxisAssistantTurnResult, PraxisAssistantTurnViewState, ProblemResponseContract, PromptContext, RulePropertyDefinition, RulePropertySchema, RulePropertyType, ValidationContext, ValueKind };
|
|
1906
|
+
export { AI_BACKEND_CONFIG_STORE, 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, PraxisAi, PraxisAiAssistantComponent, PraxisAiAssistantDockComponent, PraxisAiAssistantSessionHostComponent, PraxisAiAssistantShellComponent, PraxisAiService, PraxisAssistantSessionRegistryService, PraxisAssistantTurnController, PraxisAssistantTurnOrchestratorService, SchemaMinifierService, toPraxisAssistantConversationMessages };
|
|
1907
|
+
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, AgenticAuthoringTurnStreamConnection, AgenticAuthoringTurnStreamEnvelope, AgenticAuthoringTurnStreamEnvelopeContract, AgenticAuthoringTurnStreamRequest, AgenticAuthoringTurnStreamRequestContract, AgenticAuthoringTurnStreamStartResponse, AgenticAuthoringTurnStreamStartResponseContract, AiBackendConfigStore, AiBackendStorageOptions, AiChatMessage, AiChatMessageContract, AiClarificationUiContract, AiConfigAdapter, AiContextDTO, AiContextHintsContract, AiContextTemplate, AiContextTemplateMeta, AiCurrentStateDigest, AiCurrentStateDigestContract, AiDomainCatalogContextHintContract, AiDomainCatalogContextHintIntent, AiDomainCatalogContextHintItemType, AiDomainCatalogRelationshipHintContract, AiExamplePair, AiGlobalConfigSnapshot, 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, PraxisAssistantClarificationOption, PraxisAssistantClarificationQuestion, PraxisAssistantClarificationQuestionType, PraxisAssistantConversationMessage, PraxisAssistantConversationMessageRole, PraxisAssistantDockTone, PraxisAssistantPendingClarification, PraxisAssistantSessionDescriptor, PraxisAssistantSessionSnapshot, PraxisAssistantSessionVisibility, PraxisAssistantShellAttachment, PraxisAssistantShellContextItem, PraxisAssistantShellLabels, PraxisAssistantShellLayout, PraxisAssistantShellMessage, PraxisAssistantShellMessageAction, PraxisAssistantShellMessageRole, PraxisAssistantShellMode, PraxisAssistantShellQuickReply, PraxisAssistantShellState, PraxisAssistantTurnAction, PraxisAssistantTurnControllerOptions, PraxisAssistantTurnFlow, PraxisAssistantTurnPhase, PraxisAssistantTurnRequest, PraxisAssistantTurnResult, PraxisAssistantTurnViewState, ProblemResponseContract, PromptContext, RulePropertyDefinition, RulePropertySchema, RulePropertyType, ValidationContext, ValueKind };
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/ai",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.20",
|
|
4
4
|
"description": "AI building blocks and assistant integration for Praxis UI applications.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^20.3.0",
|
|
7
7
|
"@angular/core": "^20.3.0",
|
|
8
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^8.0.0-beta.20",
|
|
9
|
+
"@angular/cdk": "^20.3.0",
|
|
10
|
+
"@angular/forms": "^20.3.0",
|
|
11
|
+
"@angular/material": "^20.3.0",
|
|
12
|
+
"@google/generative-ai": "^0.24.1",
|
|
13
|
+
"rxjs": "~7.8.0"
|
|
9
14
|
},
|
|
10
15
|
"dependencies": {
|
|
11
16
|
"tslib": "^2.3.0"
|