@praxisui/ai 8.0.0-beta.11 → 8.0.0-beta.13
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 +18 -0
- package/fesm2022/praxisui-ai.mjs +163 -6
- package/index.d.ts +88 -17
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -196,6 +196,24 @@ Notes:
|
|
|
196
196
|
- `currentState` must be the config root (not wrapped under `config`).
|
|
197
197
|
- Clarifications may return `{ type: "clarification", message, options }`.
|
|
198
198
|
|
|
199
|
+
### Agentic authoring manifest tools
|
|
200
|
+
- `GET /api/praxis/config/ai/authoring/manifests/{componentId}`
|
|
201
|
+
- `GET /api/praxis/config/ai/authoring/manifests/{componentId}/editable-targets`
|
|
202
|
+
- `GET /api/praxis/config/ai/authoring/manifests/{componentId}/operations`
|
|
203
|
+
- `POST /api/praxis/config/ai/authoring/manifests/{componentId}/resolve-target`
|
|
204
|
+
- `POST /api/praxis/config/ai/authoring/manifests/{componentId}/validate-plan`
|
|
205
|
+
- `POST /api/praxis/config/ai/authoring/manifests/{componentId}/compile-patch`
|
|
206
|
+
|
|
207
|
+
`AiBackendApiService` exposes these endpoints through typed methods so hosts can inspect the executable manifest, resolve targets, validate a component edit plan and compile a backend-owned patch without routing by local keywords.
|
|
208
|
+
|
|
209
|
+
### Agentic authoring turn streaming
|
|
210
|
+
- `POST /api/praxis/config/ai/authoring/turn/stream/start`
|
|
211
|
+
- `GET /api/praxis/config/ai/authoring/turn/stream/{streamId}`
|
|
212
|
+
- `GET /api/praxis/config/ai/authoring/turn/stream/{streamId}/probe`
|
|
213
|
+
- `POST /api/praxis/config/ai/authoring/turn/stream/{streamId}/cancel`
|
|
214
|
+
|
|
215
|
+
`AiBackendApiService.startAgenticAuthoringTurnStream`, `connectAgenticAuthoringTurnStream` and `cancelAgenticAuthoringTurnStream` use the same SSE envelope contract as patch streaming. Browser `EventSource` cannot send custom headers, so signed stream tokens returned by the backend should be passed to `connectAgenticAuthoringTurnStream` and `cancelAgenticAuthoringTurnStream` when the backend uses signed-url stream auth.
|
|
216
|
+
|
|
199
217
|
## Assistant local history (UI)
|
|
200
218
|
|
|
201
219
|
The assistant stores a lightweight local history in the browser using `localStorage`. It is scoped by
|
package/fesm2022/praxisui-ai.mjs
CHANGED
|
@@ -65,8 +65,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
65
65
|
* Do not edit manually. Run praxis-config-starter/tools/contracts/generate-ai-contract-bindings.js.
|
|
66
66
|
*/
|
|
67
67
|
const AI_CONTRACT_VERSION = 'v1.1';
|
|
68
|
-
const AI_CONTRACT_SCHEMA_HASH = '
|
|
68
|
+
const AI_CONTRACT_SCHEMA_HASH = 'de47da5e091f33ba0e885ab6d679fd498b0bcee30479aaa98eb35b2166736311';
|
|
69
69
|
const AI_STREAM_EVENT_SCHEMA_VERSION = 'v1';
|
|
70
|
+
const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION = 'praxis.ai.context-hints.domain-catalog/v0.1';
|
|
70
71
|
const AI_STREAM_EVENT_TYPES = ['status', 'thought.step', 'heartbeat', 'result', 'error', 'cancelled'];
|
|
71
72
|
|
|
72
73
|
/**
|
|
@@ -786,6 +787,94 @@ class AiBackendApiService {
|
|
|
786
787
|
withCredentials: true,
|
|
787
788
|
});
|
|
788
789
|
}
|
|
790
|
+
startAgenticAuthoringTurnStream(request) {
|
|
791
|
+
return this.http.post(`${this.baseUrl}/authoring/turn/stream/start`, request, {
|
|
792
|
+
headers: this.buildHeaders(),
|
|
793
|
+
withCredentials: true,
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
connectAgenticAuthoringTurnStream(streamId, lastEventId, accessToken) {
|
|
797
|
+
const queryParams = [];
|
|
798
|
+
if (lastEventId?.trim()) {
|
|
799
|
+
queryParams.push(`lastEventId=${encodeURIComponent(lastEventId.trim())}`);
|
|
800
|
+
}
|
|
801
|
+
if (accessToken?.trim()) {
|
|
802
|
+
queryParams.push(`accessToken=${encodeURIComponent(accessToken.trim())}`);
|
|
803
|
+
}
|
|
804
|
+
const query = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
|
|
805
|
+
const streamPath = `${this.baseUrl}/authoring/turn/stream/${encodeURIComponent(streamId)}`;
|
|
806
|
+
const endpoint = `${streamPath}${query}`;
|
|
807
|
+
const probeEndpoint = `${streamPath}/probe${accessToken?.trim()
|
|
808
|
+
? `?accessToken=${encodeURIComponent(accessToken.trim())}`
|
|
809
|
+
: ''}`;
|
|
810
|
+
let source = null;
|
|
811
|
+
const events$ = new Observable((subscriber) => {
|
|
812
|
+
let disposed = false;
|
|
813
|
+
const openStream = async () => {
|
|
814
|
+
if (typeof EventSource === 'undefined') {
|
|
815
|
+
subscriber.error(new AiPatchStreamConnectionError('unsupported', 'EventSource is not supported in this environment.'));
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const probeStatus = await this.probePatchStreamEndpoint(probeEndpoint);
|
|
819
|
+
if (disposed) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
if (typeof probeStatus === 'number' && probeStatus >= 400) {
|
|
823
|
+
subscriber.error(new AiPatchStreamConnectionError('http_status', `Agentic authoring stream probe failed with status ${probeStatus}.`, probeStatus));
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
source = new EventSource(endpoint, { withCredentials: true });
|
|
827
|
+
source.onmessage = (messageEvent) => {
|
|
828
|
+
try {
|
|
829
|
+
const parsed = this.parsePatchStreamEnvelope(messageEvent.data);
|
|
830
|
+
subscriber.next(parsed);
|
|
831
|
+
}
|
|
832
|
+
catch (error) {
|
|
833
|
+
if (error instanceof AiPatchStreamConnectionError) {
|
|
834
|
+
subscriber.error(error);
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
subscriber.error(new AiPatchStreamConnectionError('parse', 'Failed to parse agentic authoring stream event payload.'));
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
source.onerror = () => {
|
|
841
|
+
if (!source) {
|
|
842
|
+
subscriber.error(new AiPatchStreamConnectionError('transport', 'Agentic authoring stream connection error.'));
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
if (source.readyState === EventSource.CLOSED) {
|
|
846
|
+
subscriber.error(new AiPatchStreamConnectionError('transport', 'Agentic authoring stream connection closed unexpectedly.'));
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
void openStream();
|
|
851
|
+
return () => {
|
|
852
|
+
disposed = true;
|
|
853
|
+
if (source) {
|
|
854
|
+
source.close();
|
|
855
|
+
source = null;
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
});
|
|
859
|
+
return {
|
|
860
|
+
events$,
|
|
861
|
+
close: () => {
|
|
862
|
+
if (source) {
|
|
863
|
+
source.close();
|
|
864
|
+
source = null;
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
cancelAgenticAuthoringTurnStream(streamId, accessToken) {
|
|
870
|
+
const endpoint = `${this.baseUrl}/authoring/turn/stream/${encodeURIComponent(streamId)}/cancel${accessToken?.trim()
|
|
871
|
+
? `?accessToken=${encodeURIComponent(accessToken.trim())}`
|
|
872
|
+
: ''}`;
|
|
873
|
+
return this.http.post(endpoint, {}, {
|
|
874
|
+
headers: this.buildHeaders(),
|
|
875
|
+
withCredentials: true,
|
|
876
|
+
});
|
|
877
|
+
}
|
|
789
878
|
listModels(request) {
|
|
790
879
|
return this.http.post(`${this.baseUrl}/providers/models`, request, { headers: this.buildHeaders() });
|
|
791
880
|
}
|
|
@@ -802,6 +891,24 @@ class AiBackendApiService {
|
|
|
802
891
|
const params = new HttpParams({ fromObject: { componentType } });
|
|
803
892
|
return this.http.get(`${this.contextUrl}/${componentId}`, { headers: this.buildHeaders(), params });
|
|
804
893
|
}
|
|
894
|
+
getAgenticAuthoringManifest(componentId) {
|
|
895
|
+
return this.http.get(`${this.authoringManifestUrl(componentId)}`, { headers: this.buildHeaders() });
|
|
896
|
+
}
|
|
897
|
+
listAgenticAuthoringManifestTargets(componentId) {
|
|
898
|
+
return this.http.get(`${this.authoringManifestUrl(componentId)}/editable-targets`, { headers: this.buildHeaders() });
|
|
899
|
+
}
|
|
900
|
+
listAgenticAuthoringManifestOperations(componentId) {
|
|
901
|
+
return this.http.get(`${this.authoringManifestUrl(componentId)}/operations`, { headers: this.buildHeaders() });
|
|
902
|
+
}
|
|
903
|
+
resolveAgenticAuthoringManifestTarget(componentId, request) {
|
|
904
|
+
return this.http.post(`${this.authoringManifestUrl(componentId)}/resolve-target`, request, { headers: this.buildHeaders() });
|
|
905
|
+
}
|
|
906
|
+
validateAgenticAuthoringManifestPlan(componentId, request) {
|
|
907
|
+
return this.http.post(`${this.authoringManifestUrl(componentId)}/validate-plan`, request, { headers: this.buildHeaders() });
|
|
908
|
+
}
|
|
909
|
+
compileAgenticAuthoringManifestPatch(componentId, request) {
|
|
910
|
+
return this.http.post(`${this.authoringManifestUrl(componentId)}/compile-patch`, request, { headers: this.buildHeaders() });
|
|
911
|
+
}
|
|
805
912
|
loadGlobalAiConfig() {
|
|
806
913
|
const snapshot = this.globalConfigStore?.getAiConfigSnapshot?.();
|
|
807
914
|
if (snapshot !== undefined) {
|
|
@@ -842,6 +949,9 @@ class AiBackendApiService {
|
|
|
842
949
|
}
|
|
843
950
|
return AI_INTENT_CONTRACT_SCHEMA_HASH;
|
|
844
951
|
}
|
|
952
|
+
authoringManifestUrl(componentId) {
|
|
953
|
+
return `${this.baseUrl}/authoring/manifests/${encodeURIComponent(componentId)}`;
|
|
954
|
+
}
|
|
845
955
|
resolveHeaderMap(extra) {
|
|
846
956
|
const allowLocalIdentityFallback = !!this.storageOpts?.allowLocalIdentityFallback;
|
|
847
957
|
const defaults = this.storageOpts?.defaultHeaders
|
|
@@ -1024,7 +1134,7 @@ class AiResponseValidatorService {
|
|
|
1024
1134
|
code: 'MISSING_RULE_NAME'
|
|
1025
1135
|
});
|
|
1026
1136
|
}
|
|
1027
|
-
if (!response.targetType || !['field', 'section', 'action', 'row', 'column'].includes(response.targetType)) {
|
|
1137
|
+
if (!response.targetType || !['field', 'section', 'action', 'row', 'column', 'visualBlock'].includes(response.targetType)) {
|
|
1028
1138
|
errors.push({
|
|
1029
1139
|
field: 'targetType',
|
|
1030
1140
|
message: 'targetType inválido',
|
|
@@ -1158,6 +1268,10 @@ class AiResponseValidatorService {
|
|
|
1158
1268
|
return;
|
|
1159
1269
|
}
|
|
1160
1270
|
const args = Array.isArray(rawArgs) ? rawArgs : [rawArgs];
|
|
1271
|
+
const arityIssue = this.validateJsonLogicOperatorArity(operator, args.length);
|
|
1272
|
+
if (arityIssue) {
|
|
1273
|
+
issues.push({ message: arityIssue });
|
|
1274
|
+
}
|
|
1161
1275
|
args.forEach((arg) => this.walkJsonLogicNode(arg, false, issues));
|
|
1162
1276
|
return;
|
|
1163
1277
|
}
|
|
@@ -1194,6 +1308,49 @@ class AiResponseValidatorService {
|
|
|
1194
1308
|
'max',
|
|
1195
1309
|
].includes(operator);
|
|
1196
1310
|
}
|
|
1311
|
+
validateJsonLogicOperatorArity(operator, argumentCount) {
|
|
1312
|
+
const exactArity = {
|
|
1313
|
+
'==': 2,
|
|
1314
|
+
'===': 2,
|
|
1315
|
+
'!=': 2,
|
|
1316
|
+
'!==': 2,
|
|
1317
|
+
'>': 2,
|
|
1318
|
+
'>=': 2,
|
|
1319
|
+
'<': 2,
|
|
1320
|
+
'<=': 2,
|
|
1321
|
+
'!': 1,
|
|
1322
|
+
'!!': 1,
|
|
1323
|
+
in: 2,
|
|
1324
|
+
contains: 2,
|
|
1325
|
+
startsWith: 2,
|
|
1326
|
+
endsWith: 2,
|
|
1327
|
+
'-': 2,
|
|
1328
|
+
'/': 2,
|
|
1329
|
+
'%': 2,
|
|
1330
|
+
};
|
|
1331
|
+
const expected = exactArity[operator];
|
|
1332
|
+
if (expected !== undefined && argumentCount !== expected) {
|
|
1333
|
+
return `Operator ${operator} requires exactly ${expected} argument(s).`;
|
|
1334
|
+
}
|
|
1335
|
+
if ((operator === 'and' || operator === 'or') && argumentCount < 2) {
|
|
1336
|
+
return `Operator ${operator} requires at least 2 arguments.`;
|
|
1337
|
+
}
|
|
1338
|
+
if (operator === 'if' && argumentCount < 3) {
|
|
1339
|
+
return 'Operator if requires at least 3 arguments.';
|
|
1340
|
+
}
|
|
1341
|
+
if ((operator === 'cat'
|
|
1342
|
+
|| operator === '+'
|
|
1343
|
+
|| operator === '*'
|
|
1344
|
+
|| operator === 'min'
|
|
1345
|
+
|| operator === 'max')
|
|
1346
|
+
&& argumentCount < 1) {
|
|
1347
|
+
return `Operator ${operator} requires at least 1 argument.`;
|
|
1348
|
+
}
|
|
1349
|
+
if (operator === 'substr' && (argumentCount < 2 || argumentCount > 3)) {
|
|
1350
|
+
return 'Operator substr requires 2 or 3 arguments.';
|
|
1351
|
+
}
|
|
1352
|
+
return null;
|
|
1353
|
+
}
|
|
1197
1354
|
collectVarPaths(value, collector) {
|
|
1198
1355
|
if (Array.isArray(value)) {
|
|
1199
1356
|
value.forEach((item) => this.collectVarPaths(item, collector));
|
|
@@ -5084,15 +5241,15 @@ class PraxisAiAssistantComponent {
|
|
|
5084
5241
|
.filter((value) => value.length > 0);
|
|
5085
5242
|
}
|
|
5086
5243
|
resolveBadgeContextHints(contextHints) {
|
|
5087
|
-
|
|
5244
|
+
const candidate = this.toAiJsonObject(contextHints);
|
|
5245
|
+
if (!Object.keys(candidate).length)
|
|
5088
5246
|
return null;
|
|
5089
|
-
const badge = this.asRecord(
|
|
5247
|
+
const badge = this.asRecord(candidate['badge']);
|
|
5090
5248
|
if (badge)
|
|
5091
5249
|
return this.toAiJsonObject(badge);
|
|
5092
|
-
const candidate = contextHints;
|
|
5093
5250
|
const hasBadgeKeys = ['field', 'values', 'valueColorMap', 'palette', 'inferredType', 'explicitType']
|
|
5094
5251
|
.some((key) => Object.prototype.hasOwnProperty.call(candidate, key));
|
|
5095
|
-
return hasBadgeKeys ? candidate : null;
|
|
5252
|
+
return hasBadgeKeys ? this.toAiJsonObject(candidate) : null;
|
|
5096
5253
|
}
|
|
5097
5254
|
hasBadgeValues(badgeHints) {
|
|
5098
5255
|
if (!badgeHints)
|
package/index.d.ts
CHANGED
|
@@ -18,8 +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: "de47da5e091f33ba0e885ab6d679fd498b0bcee30479aaa98eb35b2166736311";
|
|
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.1";
|
|
23
24
|
declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "result", "error", "cancelled"];
|
|
24
25
|
type AiJsonPrimitive = string | number | boolean | null;
|
|
25
26
|
type AiJsonArray = AiJsonValue[];
|
|
@@ -27,6 +28,20 @@ interface AiJsonObject {
|
|
|
27
28
|
[key: string]: AiJsonValue;
|
|
28
29
|
}
|
|
29
30
|
type AiJsonValue = AiJsonPrimitive | AiJsonObject | AiJsonArray;
|
|
31
|
+
type AiDomainCatalogContextHintItemType = 'context' | 'node' | 'edge' | 'binding' | 'evidence' | 'governance';
|
|
32
|
+
interface AiDomainCatalogContextHintContract {
|
|
33
|
+
schemaVersion?: typeof AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION;
|
|
34
|
+
serviceKey?: string;
|
|
35
|
+
type?: AiDomainCatalogContextHintItemType;
|
|
36
|
+
query?: string | null;
|
|
37
|
+
contextKey?: string | null;
|
|
38
|
+
nodeType?: string | null;
|
|
39
|
+
limit?: number;
|
|
40
|
+
}
|
|
41
|
+
interface AiContextHintsContract {
|
|
42
|
+
domainCatalog?: AiDomainCatalogContextHintContract;
|
|
43
|
+
[key: string]: AiJsonValue | AiDomainCatalogContextHintContract | undefined;
|
|
44
|
+
}
|
|
30
45
|
interface AiSchemaContextContract {
|
|
31
46
|
path?: string | null;
|
|
32
47
|
operation?: string | null;
|
|
@@ -64,7 +79,7 @@ interface AiOrchestratorRequestContract {
|
|
|
64
79
|
schemaFields?: AiJsonObject[] | null;
|
|
65
80
|
runtimeState?: AiJsonObject | null;
|
|
66
81
|
suggestedPatch?: AiJsonObject | null;
|
|
67
|
-
contextHints?:
|
|
82
|
+
contextHints?: AiContextHintsContract | null;
|
|
68
83
|
aiMode?: string;
|
|
69
84
|
requireSchema?: boolean;
|
|
70
85
|
resourcePath?: string;
|
|
@@ -86,7 +101,7 @@ interface AiOptionContract {
|
|
|
86
101
|
value?: string | null;
|
|
87
102
|
label?: string | null;
|
|
88
103
|
example?: string | null;
|
|
89
|
-
contextHints?:
|
|
104
|
+
contextHints?: AiContextHintsContract | null;
|
|
90
105
|
}
|
|
91
106
|
interface AiClarificationUiContract {
|
|
92
107
|
responseType?: 'text' | 'choice' | 'confirm' | 'mixed' | 'context';
|
|
@@ -161,7 +176,7 @@ interface AgenticAuthoringIntentResolutionRequestContract extends AgenticAuthori
|
|
|
161
176
|
provider?: string | null;
|
|
162
177
|
model?: string | null;
|
|
163
178
|
apiKey?: string | null;
|
|
164
|
-
contextHints?:
|
|
179
|
+
contextHints?: AiContextHintsContract | null;
|
|
165
180
|
}
|
|
166
181
|
interface AgenticAuthoringCandidateContract {
|
|
167
182
|
resourcePath?: string | null;
|
|
@@ -172,7 +187,7 @@ interface AgenticAuthoringCandidateContract {
|
|
|
172
187
|
score?: number | null;
|
|
173
188
|
reason?: string | null;
|
|
174
189
|
evidence?: string[] | null;
|
|
175
|
-
[key: string]: AiJsonValue | undefined;
|
|
190
|
+
[key: string]: AiJsonValue | AiContextHintsContract | undefined;
|
|
176
191
|
}
|
|
177
192
|
interface AgenticAuthoringQuickReplyContract {
|
|
178
193
|
id: string;
|
|
@@ -182,8 +197,8 @@ interface AgenticAuthoringQuickReplyContract {
|
|
|
182
197
|
description?: string | null;
|
|
183
198
|
icon?: string | null;
|
|
184
199
|
tone?: string | null;
|
|
185
|
-
contextHints?:
|
|
186
|
-
[key: string]: AiJsonValue | undefined;
|
|
200
|
+
contextHints?: AiContextHintsContract | null;
|
|
201
|
+
[key: string]: AiJsonValue | AiContextHintsContract | undefined;
|
|
187
202
|
}
|
|
188
203
|
interface AgenticAuthoringIntentResolutionResultContract {
|
|
189
204
|
valid?: boolean;
|
|
@@ -228,7 +243,7 @@ interface AgenticAuthoringPlanRequestContract extends AgenticAuthoringConversati
|
|
|
228
243
|
apiKey?: string | null;
|
|
229
244
|
currentPage?: AiJsonObject | null;
|
|
230
245
|
intentResolution?: AgenticAuthoringIntentResolutionResultContract | null;
|
|
231
|
-
contextHints?:
|
|
246
|
+
contextHints?: AiContextHintsContract | null;
|
|
232
247
|
}
|
|
233
248
|
interface AgenticAuthoringTurnStreamRequestContract extends AgenticAuthoringConversationContextContract {
|
|
234
249
|
userPrompt: string;
|
|
@@ -240,9 +255,9 @@ interface AgenticAuthoringTurnStreamRequestContract extends AgenticAuthoringConv
|
|
|
240
255
|
provider?: string | null;
|
|
241
256
|
model?: string | null;
|
|
242
257
|
apiKey?: string | null;
|
|
243
|
-
contextHints?:
|
|
258
|
+
contextHints?: AiContextHintsContract | null;
|
|
244
259
|
componentCapabilities?: AgenticAuthoringComponentCapabilitiesResultContract | null;
|
|
245
|
-
[key: string]: AiJsonValue | AgenticAuthoringComponentCapabilitiesResultContract | AgenticAuthoringConversationMessageContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringAttachmentSummaryContract[] | undefined;
|
|
260
|
+
[key: string]: AiJsonValue | AiContextHintsContract | AgenticAuthoringComponentCapabilitiesResultContract | AgenticAuthoringConversationMessageContract[] | AgenticAuthoringPendingClarificationContract | AgenticAuthoringAttachmentSummaryContract[] | undefined;
|
|
246
261
|
}
|
|
247
262
|
interface AgenticAuthoringPreviewResultContract {
|
|
248
263
|
valid?: boolean;
|
|
@@ -296,6 +311,39 @@ interface AgenticAuthoringComponentCapabilitiesResultContract {
|
|
|
296
311
|
catalogs?: AgenticAuthoringComponentCapabilityCatalogContract[];
|
|
297
312
|
[key: string]: AiJsonValue | AgenticAuthoringComponentCapabilityCatalogContract[] | undefined;
|
|
298
313
|
}
|
|
314
|
+
interface AgenticAuthoringManifestEditPlanRequestContract {
|
|
315
|
+
config?: AiJsonObject | null;
|
|
316
|
+
plan?: AiJsonObject | null;
|
|
317
|
+
}
|
|
318
|
+
interface AgenticAuthoringResolveTargetRequestContract {
|
|
319
|
+
config?: AiJsonObject | null;
|
|
320
|
+
operationId?: string | null;
|
|
321
|
+
target?: AiJsonValue;
|
|
322
|
+
input?: AiJsonValue;
|
|
323
|
+
}
|
|
324
|
+
interface AgenticAuthoringResolvedTargetContract {
|
|
325
|
+
status?: string | null;
|
|
326
|
+
componentId?: string | null;
|
|
327
|
+
operationId?: string | null;
|
|
328
|
+
kind?: string | null;
|
|
329
|
+
resolver?: string | null;
|
|
330
|
+
path?: string | null;
|
|
331
|
+
value?: AiJsonValue;
|
|
332
|
+
candidates?: string[];
|
|
333
|
+
failures?: string[];
|
|
334
|
+
}
|
|
335
|
+
interface AgenticAuthoringManifestValidationResultContract {
|
|
336
|
+
valid?: boolean;
|
|
337
|
+
failures?: string[];
|
|
338
|
+
warnings?: string[];
|
|
339
|
+
normalizedPlan?: AiJsonObject | null;
|
|
340
|
+
}
|
|
341
|
+
interface AgenticAuthoringManifestCompileResultContract {
|
|
342
|
+
compiled?: boolean;
|
|
343
|
+
failures?: string[];
|
|
344
|
+
warnings?: string[];
|
|
345
|
+
patch?: AiJsonObject | null;
|
|
346
|
+
}
|
|
299
347
|
interface AiPatchStreamStartResponseContract {
|
|
300
348
|
streamId: string;
|
|
301
349
|
threadId: string;
|
|
@@ -359,7 +407,7 @@ interface AiRuleResponse {
|
|
|
359
407
|
/** Descriptive name for the rule */
|
|
360
408
|
ruleName: string;
|
|
361
409
|
/** Type of target (scope) */
|
|
362
|
-
targetType: 'field' | 'section' | 'action' | 'row' | 'column';
|
|
410
|
+
targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock';
|
|
363
411
|
/** IDs of the target elements */
|
|
364
412
|
targetIds: string[];
|
|
365
413
|
/** Canonical JSON Logic condition payload or null for always applied */
|
|
@@ -485,7 +533,7 @@ interface RulePropertyDefinition {
|
|
|
485
533
|
}>;
|
|
486
534
|
category?: 'content' | 'appearance' | 'behavior' | 'layout' | 'validation';
|
|
487
535
|
}
|
|
488
|
-
type RulePropertySchema = Record<'field' | 'section' | 'action' | 'row' | 'column', RulePropertyDefinition[]>;
|
|
536
|
+
type RulePropertySchema = Record<'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', RulePropertyDefinition[]>;
|
|
489
537
|
|
|
490
538
|
type PraxisAssistantShellMessageRole = 'user' | 'assistant' | 'system' | 'status' | 'error';
|
|
491
539
|
type PraxisAssistantShellMode = 'config' | 'agentic-authoring' | 'chat' | 'diagnostic' | 'review' | 'inline-help';
|
|
@@ -874,7 +922,7 @@ declare class PraxisAiService {
|
|
|
874
922
|
}
|
|
875
923
|
|
|
876
924
|
declare const AI_INTENT_CONTRACT_VERSION: "v1.1";
|
|
877
|
-
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "
|
|
925
|
+
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "de47da5e091f33ba0e885ab6d679fd498b0bcee30479aaa98eb35b2166736311";
|
|
878
926
|
type AiSchemaContext = AiSchemaContextContract;
|
|
879
927
|
interface AiSuggestionsRequest {
|
|
880
928
|
componentId: string;
|
|
@@ -907,10 +955,22 @@ type AiPatchStreamEventType = AiPatchStreamEventType$1;
|
|
|
907
955
|
type AiPatchStreamStartResponse = AiPatchStreamStartResponseContract;
|
|
908
956
|
type AiPatchStreamCancelResponse = AiPatchStreamCancelResponseContract;
|
|
909
957
|
type AiPatchStreamEnvelope<TPayload extends AiJsonObject = AiJsonObject> = AiPatchStreamEnvelopeContract<TPayload>;
|
|
958
|
+
type AgenticAuthoringManifestEditPlanRequest = AgenticAuthoringManifestEditPlanRequestContract;
|
|
959
|
+
type AgenticAuthoringResolveTargetRequest = AgenticAuthoringResolveTargetRequestContract;
|
|
960
|
+
type AgenticAuthoringResolvedTarget = AgenticAuthoringResolvedTargetContract;
|
|
961
|
+
type AgenticAuthoringManifestValidationResult = AgenticAuthoringManifestValidationResultContract;
|
|
962
|
+
type AgenticAuthoringManifestCompileResult = AgenticAuthoringManifestCompileResultContract;
|
|
963
|
+
type AgenticAuthoringTurnStreamRequest = AgenticAuthoringTurnStreamRequestContract;
|
|
964
|
+
type AgenticAuthoringTurnStreamStartResponse = AgenticAuthoringTurnStreamStartResponseContract;
|
|
965
|
+
type AgenticAuthoringTurnStreamEnvelope<TPayload extends AiJsonObject = AiJsonObject> = AgenticAuthoringTurnStreamEnvelopeContract<TPayload>;
|
|
910
966
|
interface AiPatchStreamConnection {
|
|
911
967
|
events$: Observable<AiPatchStreamEnvelope>;
|
|
912
968
|
close: () => void;
|
|
913
969
|
}
|
|
970
|
+
interface AgenticAuthoringTurnStreamConnection {
|
|
971
|
+
events$: Observable<AgenticAuthoringTurnStreamEnvelope>;
|
|
972
|
+
close: () => void;
|
|
973
|
+
}
|
|
914
974
|
type AiPatchStreamConnectionErrorKind = 'unsupported' | 'http_status' | 'transport' | 'parse' | 'schema';
|
|
915
975
|
declare class AiPatchStreamConnectionError extends Error {
|
|
916
976
|
readonly kind: AiPatchStreamConnectionErrorKind;
|
|
@@ -1016,17 +1076,27 @@ declare class AiBackendApiService {
|
|
|
1016
1076
|
startPatchStream(request: AiOrchestratorRequest): Observable<AiPatchStreamStartResponse>;
|
|
1017
1077
|
connectPatchStream(streamId: string, lastEventId?: string, accessToken?: string): AiPatchStreamConnection;
|
|
1018
1078
|
cancelPatchStream(streamId: string, accessToken?: string): Observable<AiPatchStreamCancelResponse>;
|
|
1079
|
+
startAgenticAuthoringTurnStream(request: AgenticAuthoringTurnStreamRequest): Observable<AgenticAuthoringTurnStreamStartResponse>;
|
|
1080
|
+
connectAgenticAuthoringTurnStream(streamId: string, lastEventId?: string, accessToken?: string): AgenticAuthoringTurnStreamConnection;
|
|
1081
|
+
cancelAgenticAuthoringTurnStream(streamId: string, accessToken?: string): Observable<AiPatchStreamCancelResponse>;
|
|
1019
1082
|
listModels(request: AiProviderModelsRequest): Observable<AiProviderModelsResponse>;
|
|
1020
1083
|
listProviderCatalog(): Observable<AiProviderCatalogResponse>;
|
|
1021
1084
|
testProvider(request: AiProviderTestRequest): Observable<AiProviderTestResponse>;
|
|
1022
1085
|
getAiStatus(): Observable<AiProviderStatusResponse>;
|
|
1023
1086
|
getAiContext(componentId: string, componentType: string): Observable<AiContextDTO>;
|
|
1087
|
+
getAgenticAuthoringManifest(componentId: string): Observable<AiJsonObject>;
|
|
1088
|
+
listAgenticAuthoringManifestTargets(componentId: string): Observable<AiJsonObject[]>;
|
|
1089
|
+
listAgenticAuthoringManifestOperations(componentId: string): Observable<AiJsonObject[]>;
|
|
1090
|
+
resolveAgenticAuthoringManifestTarget(componentId: string, request: AgenticAuthoringResolveTargetRequest): Observable<AgenticAuthoringResolvedTarget>;
|
|
1091
|
+
validateAgenticAuthoringManifestPlan(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable<AgenticAuthoringManifestValidationResult>;
|
|
1092
|
+
compileAgenticAuthoringManifestPatch(componentId: string, request: AgenticAuthoringManifestEditPlanRequest): Observable<AgenticAuthoringManifestCompileResult>;
|
|
1024
1093
|
loadGlobalAiConfig(): Observable<AiGlobalConfigSnapshot | null>;
|
|
1025
1094
|
saveGlobalAiConfig(aiConfig: AiGlobalConfigSnapshot): Observable<void>;
|
|
1026
1095
|
getHeaderContext(): AiHeaderContext;
|
|
1027
1096
|
private buildHeaders;
|
|
1028
1097
|
private normalizeContractVersion;
|
|
1029
1098
|
private normalizeContractSchemaHash;
|
|
1099
|
+
private authoringManifestUrl;
|
|
1030
1100
|
private resolveHeaderMap;
|
|
1031
1101
|
private parsePatchStreamEnvelope;
|
|
1032
1102
|
private isPatchStreamEnvelope;
|
|
@@ -1052,6 +1122,7 @@ declare class AiResponseValidatorService {
|
|
|
1052
1122
|
private validateJsonLogicExpression;
|
|
1053
1123
|
private walkJsonLogicNode;
|
|
1054
1124
|
private isSupportedJsonLogicOperator;
|
|
1125
|
+
private validateJsonLogicOperatorArity;
|
|
1055
1126
|
private collectVarPaths;
|
|
1056
1127
|
private isValidTargetId;
|
|
1057
1128
|
private findSimilarTargetId;
|
|
@@ -1156,7 +1227,7 @@ interface ClarificationOption {
|
|
|
1156
1227
|
value: string;
|
|
1157
1228
|
example?: string;
|
|
1158
1229
|
}
|
|
1159
|
-
type ClarificationContextHints =
|
|
1230
|
+
type ClarificationContextHints = AiContextHintsContract;
|
|
1160
1231
|
interface ClarificationRichOption extends ClarificationOption {
|
|
1161
1232
|
contextHints?: ClarificationContextHints;
|
|
1162
1233
|
}
|
|
@@ -1647,7 +1718,7 @@ declare class AiContextBuilderService {
|
|
|
1647
1718
|
/**
|
|
1648
1719
|
* Builds the complete context for the AI prompt
|
|
1649
1720
|
*/
|
|
1650
|
-
buildPromptContext(fieldSchemas: Record<string, FieldSchemaLike>, targetType: 'field' | 'section' | 'action' | 'row' | 'column', propertySchema: RulePropertySchema): PromptContext;
|
|
1721
|
+
buildPromptContext(fieldSchemas: Record<string, FieldSchemaLike>, targetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock', propertySchema: RulePropertySchema): PromptContext;
|
|
1651
1722
|
buildRulePrompt(userPrompt: string, context: PromptContext): string;
|
|
1652
1723
|
buildSuggestionPrompt(context: PromptContext): string;
|
|
1653
1724
|
/**
|
|
@@ -1676,7 +1747,7 @@ declare class AiRuleWizardDialogComponent implements OnInit {
|
|
|
1676
1747
|
private snackBar;
|
|
1677
1748
|
private contextBuilder;
|
|
1678
1749
|
private cdr;
|
|
1679
|
-
selectedTargetType: 'field' | 'section' | 'action' | 'row' | 'column';
|
|
1750
|
+
selectedTargetType: 'field' | 'section' | 'action' | 'row' | 'column' | 'visualBlock';
|
|
1680
1751
|
userPrompt: string;
|
|
1681
1752
|
isGenerating: boolean;
|
|
1682
1753
|
validationError: string | null;
|
|
@@ -1713,4 +1784,4 @@ declare class AiRuleWizardDialogComponent implements OnInit {
|
|
|
1713
1784
|
}
|
|
1714
1785
|
|
|
1715
1786
|
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 };
|
|
1716
|
-
export type { AgenticAuthoringApplyRequestContract, AgenticAuthoringApplyResultContract, AgenticAuthoringAttachmentSummaryContract, AgenticAuthoringCandidateContract, AgenticAuthoringComponentCapabilitiesResultContract, AgenticAuthoringComponentCapabilityCatalogContract, AgenticAuthoringComponentCapabilityContract, AgenticAuthoringComponentCapabilityExampleContract, AgenticAuthoringComponentFieldAliasContract, AgenticAuthoringConversationContextContract, AgenticAuthoringConversationMessageContract, AgenticAuthoringIntentResolutionRequestContract, AgenticAuthoringIntentResolutionResultContract, AgenticAuthoringPendingClarificationContract, AgenticAuthoringPlanRequestContract, AgenticAuthoringPreviewResultContract, AgenticAuthoringQuickReplyContract, AgenticAuthoringResourceCandidatesRequestContract, AgenticAuthoringResourceCandidatesResultContract, AgenticAuthoringTurnStreamEnvelopeContract, AgenticAuthoringTurnStreamRequestContract, AgenticAuthoringTurnStreamStartResponseContract, AiBackendConfigStore, AiBackendStorageOptions, AiChatMessage, AiChatMessageContract, AiClarificationUiContract, AiConfigAdapter, AiContextDTO, AiContextTemplate, AiContextTemplateMeta, AiCurrentStateDigest, AiCurrentStateDigestContract, 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 };
|
|
1787
|
+
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, 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 };
|
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.13",
|
|
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.13"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"tslib": "^2.3.0"
|