@praxisui/ai 8.0.0-beta.18 → 8.0.0-beta.19
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/fesm2022/praxisui-ai.mjs +30 -2
- package/index.d.ts +5 -2
- package/package.json +2 -2
package/fesm2022/praxisui-ai.mjs
CHANGED
|
@@ -65,7 +65,7 @@ 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 = 'af6037b884417c7ec7b3d7e98737699c3972fde5b610f22a6d7c76eb77eb0e0a';
|
|
69
69
|
const AI_STREAM_EVENT_SCHEMA_VERSION = 'v1';
|
|
70
70
|
const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION = 'praxis.ai.context-hints.domain-catalog/v0.1';
|
|
71
71
|
const AI_STREAM_EVENT_TYPES = ['status', 'thought.step', 'heartbeat', 'result', 'error', 'cancelled'];
|
|
@@ -2539,7 +2539,7 @@ class PraxisAiAssistantComponent {
|
|
|
2539
2539
|
: undefined;
|
|
2540
2540
|
const normalizedRuntimeState = runtimeState !== undefined ? this.toAiJsonObject(runtimeState) : undefined;
|
|
2541
2541
|
const normalizedSuggestedPatch = suggestion?.patch ? this.toAiJsonObject(suggestion.patch) : undefined;
|
|
2542
|
-
const normalizedContextHints = this.
|
|
2542
|
+
const normalizedContextHints = this.enrichDomainCatalogAuthoringHints(mergedContextHints);
|
|
2543
2543
|
const patchRequest = {
|
|
2544
2544
|
componentId,
|
|
2545
2545
|
componentType,
|
|
@@ -5293,6 +5293,34 @@ class PraxisAiAssistantComponent {
|
|
|
5293
5293
|
}
|
|
5294
5294
|
return this.toClarificationContextHints(merged) ?? null;
|
|
5295
5295
|
}
|
|
5296
|
+
enrichDomainCatalogAuthoringHints(value) {
|
|
5297
|
+
const normalized = this.toClarificationContextHints(value);
|
|
5298
|
+
if (!normalized)
|
|
5299
|
+
return undefined;
|
|
5300
|
+
const domainCatalog = this.asRecord(normalized['domainCatalog']);
|
|
5301
|
+
const recommendedOperation = domainCatalog?.['recommendedOperation'];
|
|
5302
|
+
if (typeof recommendedOperation !== 'string' || !recommendedOperation.trim()) {
|
|
5303
|
+
return normalized;
|
|
5304
|
+
}
|
|
5305
|
+
const operationId = recommendedOperation.trim();
|
|
5306
|
+
const enriched = this.toAiJsonObject(normalized);
|
|
5307
|
+
enriched['authoringOperation'] = this.toAiJsonObject({
|
|
5308
|
+
operationId,
|
|
5309
|
+
source: 'domainCatalog.recommendedOperation',
|
|
5310
|
+
reviewRequired: true,
|
|
5311
|
+
materializeOnlyAfterReview: true,
|
|
5312
|
+
});
|
|
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
|
+
return this.toClarificationContextHints(enriched);
|
|
5323
|
+
}
|
|
5296
5324
|
setResourcePathHint(resourcePath) {
|
|
5297
5325
|
const raw = (resourcePath || '').trim();
|
|
5298
5326
|
const normalized = this.normalizeResourcePath(raw);
|
package/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ 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: "af6037b884417c7ec7b3d7e98737699c3972fde5b610f22a6d7c76eb77eb0e0a";
|
|
22
22
|
declare const AI_STREAM_EVENT_SCHEMA_VERSION: "v1";
|
|
23
23
|
declare const AI_DOMAIN_CATALOG_CONTEXT_HINT_SCHEMA_VERSION: "praxis.ai.context-hints.domain-catalog/v0.1";
|
|
24
24
|
declare const AI_STREAM_EVENT_TYPES: readonly ["status", "thought.step", "heartbeat", "result", "error", "cancelled"];
|
|
@@ -30,6 +30,7 @@ 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 AiDomainCatalogRecommendedOperation = 'rule.visibility.add' | 'rule.validation.add' | 'rule.visualBlockGuidance.add' | 'rule.remove';
|
|
33
34
|
interface AiDomainCatalogRelationshipHintContract {
|
|
34
35
|
enabled?: boolean;
|
|
35
36
|
federated?: boolean;
|
|
@@ -52,6 +53,7 @@ interface AiDomainCatalogContextHintContract {
|
|
|
52
53
|
query?: string | null;
|
|
53
54
|
contextKey?: string | null;
|
|
54
55
|
nodeType?: string | null;
|
|
56
|
+
recommendedOperation?: AiDomainCatalogRecommendedOperation | null;
|
|
55
57
|
limit?: number;
|
|
56
58
|
relationships?: AiDomainCatalogRelationshipHintContract | null;
|
|
57
59
|
}
|
|
@@ -939,7 +941,7 @@ declare class PraxisAiService {
|
|
|
939
941
|
}
|
|
940
942
|
|
|
941
943
|
declare const AI_INTENT_CONTRACT_VERSION: "v1.1";
|
|
942
|
-
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "
|
|
944
|
+
declare const AI_INTENT_CONTRACT_SCHEMA_HASH: "af6037b884417c7ec7b3d7e98737699c3972fde5b610f22a6d7c76eb77eb0e0a";
|
|
943
945
|
type AiSchemaContext = AiSchemaContextContract;
|
|
944
946
|
interface AiSuggestionsRequest {
|
|
945
947
|
componentId: string;
|
|
@@ -1578,6 +1580,7 @@ declare class PraxisAiAssistantComponent implements OnDestroy {
|
|
|
1578
1580
|
private hasBadgeColors;
|
|
1579
1581
|
private hasBadgeField;
|
|
1580
1582
|
private mergeContextHints;
|
|
1583
|
+
private enrichDomainCatalogAuthoringHints;
|
|
1581
1584
|
private setResourcePathHint;
|
|
1582
1585
|
private clearResourcePathHint;
|
|
1583
1586
|
private matchClarificationOptionPath;
|
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.19",
|
|
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.19"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"tslib": "^2.3.0"
|