@c8y/ngx-components 1023.92.0 → 1023.96.0
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/ai/agents/scada/index.d.ts +10 -0
- package/ai/agents/scada/index.d.ts.map +1 -0
- package/ai/ai-chat/index.d.ts +1 -1
- package/ai/ai-chat/index.d.ts.map +1 -1
- package/computed-asset-properties/index.d.ts +89 -1
- package/computed-asset-properties/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +18 -8
- package/context-dashboard/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +2 -2
- package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs +893 -0
- package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +1 -0
- package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +2 -2
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs → c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs} +10 -9
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-CHZX7ALq.mjs.map +1 -0
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-LrmlAh6V.mjs.map → c8y-ngx-components-computed-asset-properties-fieldbus-item-status-config.component-DgWGXzEx.mjs.map} +1 -1
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs} +2 -2
- package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-f1u1TcCl.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-yfc45-l_.mjs.map} +1 -1
- package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +44 -36
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +112 -22
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs +292 -115
- package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +2 -2
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs +169 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs +8 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +90 -32
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +1698 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components.mjs +190 -40
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +58 -3
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +74 -22
- package/index.d.ts.map +1 -1
- package/locales/de.po +108 -0
- package/locales/es.po +108 -0
- package/locales/fr.po +108 -0
- package/locales/ja_JP.po +108 -0
- package/locales/ko.po +108 -0
- package/locales/locales.pot +150 -3
- package/locales/nl.po +108 -0
- package/locales/pl.po +108 -0
- package/locales/pt_BR.po +108 -0
- package/locales/zh_CN.po +108 -0
- package/locales/zh_TW.po +108 -0
- package/package.json +1 -1
- package/repository/configuration/index.d.ts +64 -39
- package/repository/configuration/index.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/definitions/scada/index.d.ts +6 -0
- package/widgets/definitions/scada/index.d.ts.map +1 -0
- package/widgets/device-management-exports/index.d.ts +6 -0
- package/widgets/device-management-exports/index.d.ts.map +1 -1
- package/widgets/exports/index.d.ts +8 -1
- package/widgets/exports/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +30 -12
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/widgets/implementations/scada/index.d.ts +415 -0
- package/widgets/implementations/scada/index.d.ts.map +1 -0
- package/fesm2022/c8y-ngx-components-computed-asset-properties-c8y-ngx-components-computed-asset-properties-Cy9R6Ixb.mjs.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientAgentDefinition } from '@c8y/ngx-components/ai';
|
|
2
|
+
|
|
3
|
+
declare const SCADA_OUTPUT_TAG_NAME = "c8y-scada-output";
|
|
4
|
+
declare const SVG_EXTRACT_TAG_NAME = "c8y-svg-extract";
|
|
5
|
+
declare const MAPPING_EXTRACT_TAG_NAME = "c8y-mapping-extract";
|
|
6
|
+
|
|
7
|
+
declare const SCADA_SVG_AGENT_DEFINITION: ClientAgentDefinition;
|
|
8
|
+
|
|
9
|
+
export { MAPPING_EXTRACT_TAG_NAME, SCADA_OUTPUT_TAG_NAME, SCADA_SVG_AGENT_DEFINITION, SVG_EXTRACT_TAG_NAME };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../../ai/agents/scada/scada-svg.agent.c8y.ts","../../../../ai/agents/scada/scada-svg-agent.definition.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;AAEA,cAAA,qBAAA;AACA,cAAA,oBAAA;AACA,cAAA,wBAAA;;ACOA,cAAA,0BAAA,EAAA,qBAAA;;;;"}
|
package/ai/ai-chat/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../ai/ai-chat/ai-chat-assistant-message.component.ts","../../../ai/ai-chat/ai-chat-assistant-part.component.ts","../../../ai/ai-chat/ai-chat-message-action.component.ts","../../../ai/ai-chat/ai-chat-message.component.ts","../../../ai/ai-chat/ai-chat-suggestion.component.ts","../../../ai/ai-chat/ai-chat-tool-call.component.ts","../../../ai/ai-chat/ai-chat.component.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;AAqBA;;;AAGG;;;;;;;;AAUF;AAED;;;AAGG;AACH;AAcE;;;AAGG;;AAGH;;AAEG;;AAGH;;;AAGG;AACH;AAEA;;AAEG;AACH;AAEA;;AA2GiB;AACE;AAxGjB;;AAYF;;;AAGG;AACH;AAIA;;;;AAIG;AACH;AA8BA;AAQA;;;;;AAKG;AACH;;;AAuBA;;;;;;;;;AASG;AACH;;;AAGC;AA8DD;;;;;;AAMG;AACH;;;AA0BD;;AC1QD;AACA;;;;AAuBE;;;AAGG;;;AAIH;;;;AAKD;;AC7CD;;;AAGG;AACH;AAOE;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;;AAIH;;AAEG;AAEH;;;AACD;;ACpCD;;;;;AAKG;AACH;;;AAYE;AAEA;AAIA;;;;AAIG;;AAUH;;;;AAIG;;;;AAgBJ;;AC9DD;;;AAGG;AACH;AAQE;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;;;AAQJ;;ACjDD;AAcE;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAEH;;AAEG;;AAGH;;AAEG;;AAGH;AACA;AAEA;AAEA;;;;AAgCD;;ACpED;;;;AAIG;AACH;AAoBE;;;AAGG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;;;AAIG;AAEH;;AAGS;AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../ai/ai-chat/ai-chat-assistant-message.component.ts","../../../ai/ai-chat/ai-chat-assistant-part.component.ts","../../../ai/ai-chat/ai-chat-message-action.component.ts","../../../ai/ai-chat/ai-chat-message.component.ts","../../../ai/ai-chat/ai-chat-suggestion.component.ts","../../../ai/ai-chat/ai-chat-tool-call.component.ts","../../../ai/ai-chat/ai-chat.component.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;AAqBA;;;AAGG;;;;;;;;AAUF;AAED;;;AAGG;AACH;AAcE;;;AAGG;;AAGH;;AAEG;;AAGH;;;AAGG;AACH;AAEA;;AAEG;AACH;AAEA;;AA2GiB;AACE;AAxGjB;;AAYF;;;AAGG;AACH;AAIA;;;;AAIG;AACH;AA8BA;AAQA;;;;;AAKG;AACH;;;AAuBA;;;;;;;;;AASG;AACH;;;AAGC;AA8DD;;;;;;AAMG;AACH;;;AA0BD;;AC1QD;AACA;;;;AAuBE;;;AAGG;;;AAIH;;;;AAKD;;AC7CD;;;AAGG;AACH;AAOE;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;;AAIH;;AAEG;AAEH;;;AACD;;ACpCD;;;;;AAKG;AACH;;;AAYE;AAEA;AAIA;;;;AAIG;;AAUH;;;;AAIG;;;;AAgBJ;;AC9DD;;;AAGG;AACH;AAQE;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;;;AAQJ;;ACjDD;AAcE;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAGH;;AAEG;;AAEH;;AAEG;;AAGH;;AAEG;;AAGH;AACA;AAEA;AAEA;;;;AAgCD;;ACpED;;;;AAIG;AACH;AAoBE;;;AAGG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;AAEH;AAEA;;;;AAIG;AAEH;;AAGS;AAEA;;;;AAIR;AAED;;;AAGG;AAEH;AAEA;;AAEG;AAEH;AAEA;;AAEG;;AAGH;;AAEG;AACH;;;;AAoCA;;;;;AAKG;;;AASH;;;;AAIG;AACH;AAWA;;;AAGG;AACH;;;AAGD;;;"}
|
|
@@ -1,7 +1,95 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { MeasurementRealtimeService, ManagedObjectRealtimeService, AlarmRealtimeService, EventRealtimeService, OperationRealtimeService } from '@c8y/ngx-components';
|
|
3
|
+
import { IManagedObject } from '@c8y/client';
|
|
4
|
+
import { AssetPropertyType } from '@c8y/ngx-components/asset-properties';
|
|
5
|
+
|
|
6
|
+
interface FieldbusDevice extends IManagedObject {
|
|
7
|
+
c8y_ModbusDevice?: {
|
|
8
|
+
address: number;
|
|
9
|
+
protocol: string;
|
|
10
|
+
ipAddress: string;
|
|
11
|
+
/** Reference URL to Fieldbus device type (e.g. /inventory/managedObjects/12345). */
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
c8y_CoilStatus?: {
|
|
15
|
+
[name: string]: number;
|
|
16
|
+
};
|
|
17
|
+
c8y_RegisterStatus?: {
|
|
18
|
+
[name: string]: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface FieldbusDeviceType extends IManagedObject {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
fieldbusType: string;
|
|
25
|
+
c8y_Coils?: FieldbusCoil[];
|
|
26
|
+
c8y_Registers?: FieldbusRegister[];
|
|
27
|
+
}
|
|
28
|
+
interface FieldbusCoil {
|
|
29
|
+
number: number;
|
|
30
|
+
name: string;
|
|
31
|
+
input: boolean;
|
|
32
|
+
statusMapping: {
|
|
33
|
+
status: 'read' | 'write';
|
|
34
|
+
};
|
|
35
|
+
enumValues?: {
|
|
36
|
+
[value: number]: string;
|
|
37
|
+
};
|
|
38
|
+
alarmMapping?: {
|
|
39
|
+
severity: 'CRITICAL' | 'MAJOR' | 'MINOR' | 'WARNING';
|
|
40
|
+
type: string;
|
|
41
|
+
text: string;
|
|
42
|
+
raiseAlarmTemplate: number;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface FieldbusRegister {
|
|
46
|
+
number: number;
|
|
47
|
+
input: boolean;
|
|
48
|
+
startBit: number;
|
|
49
|
+
noBits: number;
|
|
50
|
+
name: string;
|
|
51
|
+
multiplier: number;
|
|
52
|
+
divisor: number;
|
|
53
|
+
decimalPlaces: number;
|
|
54
|
+
unit: string;
|
|
55
|
+
signed: boolean;
|
|
56
|
+
min: number;
|
|
57
|
+
max: number;
|
|
58
|
+
category: string;
|
|
59
|
+
measurementMapping?: {
|
|
60
|
+
series: string;
|
|
61
|
+
sendMeasurementTemplate: number;
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
statusMapping?: {
|
|
65
|
+
status: 'read' | 'write';
|
|
66
|
+
};
|
|
67
|
+
enumValues?: {
|
|
68
|
+
[value: number]: string;
|
|
69
|
+
};
|
|
70
|
+
eventMapping?: {
|
|
71
|
+
eventTemplate: number;
|
|
72
|
+
type: string;
|
|
73
|
+
text: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
interface LegacyFieldbusProperty {
|
|
77
|
+
fieldbus: true;
|
|
78
|
+
id: string;
|
|
79
|
+
keyPath: [string, string];
|
|
80
|
+
label: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class FieldbusService {
|
|
84
|
+
private inventory;
|
|
85
|
+
private computedProperties;
|
|
86
|
+
getDeviceTypeOf(fieldbusDevice: FieldbusDevice): Promise<FieldbusDeviceType>;
|
|
87
|
+
migrateFieldbusProperty(legacyProperty: LegacyFieldbusProperty, fieldbusDevice: FieldbusDevice): Promise<AssetPropertyType>;
|
|
88
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FieldbusService, never>;
|
|
89
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<FieldbusService>;
|
|
90
|
+
}
|
|
3
91
|
|
|
4
92
|
declare const computedAssetPropertiesProviders: (typeof MeasurementRealtimeService | _angular_core.ValueProvider | _angular_core.ClassProvider | _angular_core.ExistingProvider | typeof ManagedObjectRealtimeService | typeof AlarmRealtimeService | typeof EventRealtimeService | typeof OperationRealtimeService)[];
|
|
5
93
|
|
|
6
|
-
export { computedAssetPropertiesProviders };
|
|
94
|
+
export { FieldbusService, computedAssetPropertiesProviders };
|
|
7
95
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../computed-asset-properties/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../computed-asset-properties/fieldbus-item-status/fieldbus-item-status.model.ts","../../computed-asset-properties/fieldbus-item-status/fieldbus.service.ts","../../computed-asset-properties/index.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":";;;;;AAcM;AACJ;;;;;;;AAOA;AACE;;AAEF;AACE;;AAEH;AAEK;;;;AAIJ;AACA;AACD;;;;;AAMC;AACE;;AAEF;AACE;;AAEF;;;;;;AAMD;;;;;;;;;;;;;;;AAgBC;;;;;AAKA;AACE;;AAEF;AACE;;AAEF;;;;;AAKD;;;;AAKC;;AAED;;ACpFD;;;;AA8BQ;;;AAkCP;;ACrDD;;"}
|
|
@@ -1123,7 +1123,7 @@ declare class TypeDashboardInfoComponent implements OnInit {
|
|
|
1123
1123
|
type AssetPropertyMappings = {
|
|
1124
1124
|
[name: string]: {
|
|
1125
1125
|
label?: string;
|
|
1126
|
-
assetProperty: AssetPropertyType;
|
|
1126
|
+
assetProperty: AssetPropertyType | null;
|
|
1127
1127
|
};
|
|
1128
1128
|
};
|
|
1129
1129
|
type AssetPropertyMapping = {
|
|
@@ -1870,9 +1870,10 @@ declare class AssetPropertyMappingsService {
|
|
|
1870
1870
|
*
|
|
1871
1871
|
* @param mappings - The asset property mappings configuration.
|
|
1872
1872
|
* @param realtimeControl$ - Observable that controls realtime notifications (true = enabled, false = disabled, default = enabled).
|
|
1873
|
+
* @param refresh$ - Optional trigger; each emission forces a fresh REST fetch of all property values.
|
|
1873
1874
|
* @returns Observable emitting updated asset property values as they change.
|
|
1874
1875
|
*/
|
|
1875
|
-
getValues$(mappings: AssetPropertyMappings, realtimeControl$?: Observable$1<boolean>): Observable$1<Record<string, unknown>>;
|
|
1876
|
+
getValues$(mappings: AssetPropertyMappings, realtimeControl$?: Observable$1<boolean>, refresh$?: Observable$1<void>): Observable$1<Record<string, unknown>>;
|
|
1876
1877
|
private groupByType;
|
|
1877
1878
|
private groupByAssetId;
|
|
1878
1879
|
private getComputedPropertyValues$;
|
|
@@ -1893,6 +1894,10 @@ declare class AssetPropertyMappingsComponent implements OnInit {
|
|
|
1893
1894
|
allowAddingNewMappings: i0.InputSignal<boolean>;
|
|
1894
1895
|
allowRenamingMappings: i0.InputSignal<boolean>;
|
|
1895
1896
|
allowRelabellingMappings: i0.InputSignal<boolean>;
|
|
1897
|
+
/** When set, mapping names must match this regex. Validated on rename. */
|
|
1898
|
+
mappingNameFormatRegex: i0.InputSignal<RegExp>;
|
|
1899
|
+
/** Error message shown when a name fails the mappingNameFormatRegex check. */
|
|
1900
|
+
mappingNameFormatErrorMessage: i0.InputSignal<string>;
|
|
1896
1901
|
allowEditingMappings: i0.InputSignal<boolean>;
|
|
1897
1902
|
allowRemovingMappings: i0.InputSignal<boolean>;
|
|
1898
1903
|
showLabels: i0.InputSignal<boolean>;
|
|
@@ -1905,8 +1910,14 @@ declare class AssetPropertyMappingsComponent implements OnInit {
|
|
|
1905
1910
|
* Callback to transform a mapping into the text that gets copied to the clipboard.
|
|
1906
1911
|
* Exposed as an input so widget config factories can override the default (e.g. to
|
|
1907
1912
|
* produce a template expression like `${this.c8yProperties?.temperature}`).
|
|
1908
|
-
|
|
1909
|
-
|
|
1913
|
+
* The second argument is the current widget config, which can be used to adjust
|
|
1914
|
+
* the output based on widget-specific settings (e.g. legacy mode).
|
|
1915
|
+
*/
|
|
1916
|
+
onBeforeCopyMappingToClipboard: i0.InputSignal<(mapping: AssetPropertyMapping, config?: ContextWidgetConfig | null) => string>;
|
|
1917
|
+
emptyStateTitle: i0.InputSignal<string>;
|
|
1918
|
+
emptyStateSubtitle: i0.InputSignal<string>;
|
|
1919
|
+
/** Message shown in the section's feedback area. Available placeholder: {{ count }} */
|
|
1920
|
+
feedbackMessage: i0.InputSignal<string>;
|
|
1910
1921
|
/** Distributes (12 - actionsColumnSpan) columns evenly among visible row-1 columns (label, name). */
|
|
1911
1922
|
get row1ColumnSpans(): {
|
|
1912
1923
|
label: number;
|
|
@@ -1918,8 +1929,6 @@ declare class AssetPropertyMappingsComponent implements OnInit {
|
|
|
1918
1929
|
property: number;
|
|
1919
1930
|
value: number;
|
|
1920
1931
|
};
|
|
1921
|
-
emptyStateTitle: "No asset property mappings";
|
|
1922
|
-
emptyStateSubtitle: "Add first asset property mapping.";
|
|
1923
1932
|
mappings$: rxjs.Observable<AssetPropertyMappings>;
|
|
1924
1933
|
keys$: rxjs.Observable<string[]>;
|
|
1925
1934
|
private readonly mappingsSignal;
|
|
@@ -1945,7 +1954,7 @@ declare class AssetPropertyMappingsComponent implements OnInit {
|
|
|
1945
1954
|
saveName(key: string, newName: string): Promise<void>;
|
|
1946
1955
|
private distributeColumns;
|
|
1947
1956
|
static ɵfac: i0.ɵɵFactoryDeclaration<AssetPropertyMappingsComponent, never>;
|
|
1948
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AssetPropertyMappingsComponent, "c8y-asset-property-mappings", never, { "widgetConfigPath": { "alias": "widgetConfigPath"; "required": false; "isSignal": true; }; "initialMappings": { "alias": "initialMappings"; "required": false; "isSignal": true; }; "allowAddingNewMappings": { "alias": "allowAddingNewMappings"; "required": false; "isSignal": true; }; "allowRenamingMappings": { "alias": "allowRenamingMappings"; "required": false; "isSignal": true; }; "allowRelabellingMappings": { "alias": "allowRelabellingMappings"; "required": false; "isSignal": true; }; "allowEditingMappings": { "alias": "allowEditingMappings"; "required": false; "isSignal": true; }; "allowRemovingMappings": { "alias": "allowRemovingMappings"; "required": false; "isSignal": true; }; "showLabels": { "alias": "showLabels"; "required": false; "isSignal": true; }; "showNames": { "alias": "showNames"; "required": false; "isSignal": true; }; "showAssets": { "alias": "showAssets"; "required": false; "isSignal": true; }; "showProperties": { "alias": "showProperties"; "required": false; "isSignal": true; }; "showValues": { "alias": "showValues"; "required": false; "isSignal": true; }; "actionsColumnSpan": { "alias": "actionsColumnSpan"; "required": false; "isSignal": true; }; "onBeforeCopyMappingToClipboard": { "alias": "onBeforeCopyMappingToClipboard"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1957
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AssetPropertyMappingsComponent, "c8y-asset-property-mappings", never, { "widgetConfigPath": { "alias": "widgetConfigPath"; "required": false; "isSignal": true; }; "initialMappings": { "alias": "initialMappings"; "required": false; "isSignal": true; }; "allowAddingNewMappings": { "alias": "allowAddingNewMappings"; "required": false; "isSignal": true; }; "allowRenamingMappings": { "alias": "allowRenamingMappings"; "required": false; "isSignal": true; }; "allowRelabellingMappings": { "alias": "allowRelabellingMappings"; "required": false; "isSignal": true; }; "mappingNameFormatRegex": { "alias": "mappingNameFormatRegex"; "required": false; "isSignal": true; }; "mappingNameFormatErrorMessage": { "alias": "mappingNameFormatErrorMessage"; "required": false; "isSignal": true; }; "allowEditingMappings": { "alias": "allowEditingMappings"; "required": false; "isSignal": true; }; "allowRemovingMappings": { "alias": "allowRemovingMappings"; "required": false; "isSignal": true; }; "showLabels": { "alias": "showLabels"; "required": false; "isSignal": true; }; "showNames": { "alias": "showNames"; "required": false; "isSignal": true; }; "showAssets": { "alias": "showAssets"; "required": false; "isSignal": true; }; "showProperties": { "alias": "showProperties"; "required": false; "isSignal": true; }; "showValues": { "alias": "showValues"; "required": false; "isSignal": true; }; "actionsColumnSpan": { "alias": "actionsColumnSpan"; "required": false; "isSignal": true; }; "onBeforeCopyMappingToClipboard": { "alias": "onBeforeCopyMappingToClipboard"; "required": false; "isSignal": true; }; "emptyStateTitle": { "alias": "emptyStateTitle"; "required": false; "isSignal": true; }; "emptyStateSubtitle": { "alias": "emptyStateSubtitle"; "required": false; "isSignal": true; }; "feedbackMessage": { "alias": "feedbackMessage"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1949
1958
|
}
|
|
1950
1959
|
|
|
1951
1960
|
/**
|
|
@@ -1959,6 +1968,7 @@ declare class AssetPropertyMappingsComponent implements OnInit {
|
|
|
1959
1968
|
* - All other properties: strips leading `c8y_` and camelCases the name.
|
|
1960
1969
|
*/
|
|
1961
1970
|
declare function getPropertyBaseKey(property: AssetPropertyType): string;
|
|
1971
|
+
declare function escapeForRegExp(key: string): string;
|
|
1962
1972
|
/** Wraps key in quotes for bracket notation, choosing the quote style that requires fewest escapes. */
|
|
1963
1973
|
declare function quoteAndEscape(key: string): string;
|
|
1964
1974
|
/**
|
|
@@ -1975,6 +1985,6 @@ declare function quoteAndEscape(key: string): string;
|
|
|
1975
1985
|
*/
|
|
1976
1986
|
declare function renamePropertyKeyInCode(code: string, oldKey: string, newKey: string, expressionPrefixes?: string[]): string;
|
|
1977
1987
|
|
|
1978
|
-
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, AssetPropertyMappingsComponent, AssetPropertyMappingsService, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, getPropertyBaseKey, hookWidgetConfig, newDashboardTab, quoteAndEscape, renamePropertyKeyInCode };
|
|
1988
|
+
export { ALL_GLOBAL_ROLES_SELECTED, AddDashboardComponent, AddDashboardFactory, AppearanceSettingsComponent, AssetPropertyMappingsComponent, AssetPropertyMappingsService, CONTEXT_DASHBOARD_CONFIG, ContextDashboardComponent, ContextDashboardModule, ContextDashboardService, ContextDashboardType, DASHBOARD_CHILDREN_STATE_NAME, DASHBOARD_DETAILS_OUTLET, DASHBOARD_DETAILS_TABS_OUTLET_NAME, DASHBOARD_SETTINGS_CHANGES, DASHBOARD_THEME_CLASSES, DashboardActionBarFactory, DashboardDetailComponent, DashboardDetailService, DashboardDetailsTabId, DeviceInfoDashboardComponent, DeviceInfoDashboardModule, DeviceManagementHomeDashboardComponent, DeviceManagementHomeDashboardModule, GlobalContextSectionComponent, HOOK_WIDGET_CONFIG, NewDashboardGuard, PRODUCT_EXPERIENCE, PasteDashboardActionComponent, REPORT_DEFAULT_NAVIGATION_NODE_PRIORITY, STYLING_CLASS_PREFIXES, TypeDashboardInfoComponent, WIDGET_CONTENT_CLASSES, WIDGET_HEADER_CLASSES, WidgetAssetSelectorComponent, WidgetConfigAppearanceComponent, WidgetConfigComponent, WidgetConfigFeedbackComponent, WidgetConfigGeneralComponent, WidgetConfigSectionComponent, WidgetConfigSectionService, WidgetConfigService, WidgetPreviewComponent, WidgetPreviewWrapperComponent, WidgetService, escapeForRegExp, getPropertyBaseKey, hookWidgetConfig, newDashboardTab, quoteAndEscape, renamePropertyKeyInCode };
|
|
1979
1989
|
export type { AllowTypeDashboard, AssetPropertyMapping, AssetPropertyMappingKeyRenamedNotification, AssetPropertyMappings, CanDeactivateComponent, ContextDashboard, ContextDashboardConfig, ContextDashboardManagedObject, ContextWidgetConfig, CustomWidgetConfigNotification, DashboardAndWidgetThemeDefinition, DashboardChildrenState, DashboardContext, DashboardCopyClipboard, DashboardDetailsTabs, DashboardGlobalRoles, DashboardHistoryDescription, DashboardMetadata, WidgetConfigNotification, WidgetConfigSection, WidgetConfigSectionBase, WidgetConfigSectionDefinition, WidgetConfigSectionExtension };
|
|
1980
1990
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config/asset-property-mappings.model.ts","../../context-dashboard/widget-config.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts","../../context-dashboard/widget-config/asset-property-mappings.service.ts","../../context-dashboard/widget-config/asset-property-mappings.component.ts","../../context-dashboard/widget-config/asset-property-mappings.utils.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAQI;AACA;AADQ;;;;AAoBX;;ACpBD;AACE;;;;AAMM;;AAoCP;;ACzCD;AACA;;;;;;;;;;;;;;;;;AAkBE;;AAEG;AACH;AACD;;AAGC;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;AACH;AACE;;AAEG;AACH;;AAEF;;;AAGG;AACH;AACE;;AAEA;;AAEF;;;;;AAKG;AACH;AACA;;;;;;AAMG;AACH;AAEA;;AAEG;AACH;AACD;AAEK;;;AAGJ;AACD;;AAGC;AACA;AACA;AACA;AACA;AACA;AACA;AAAY;AAAwB;AACpC;AAAkB;AAAwB;AAC1C;AACA;AACA;AACA;AACA;;;AAGG;AACH;AACA;AACE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AAAmB;;AACpB;AACD;;AAEG;;AAED;;AAEG;;AAEH;;AAEG;AACH;AACA;;AAEG;AACH;AACA;;;;;;;;AAQG;AACH;AACE;AACA;AACA;AACA;AACD;AACD;;AAEG;;AAEJ;AAED;;;;;;;AAOA;;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AAIG;;AAwBH;;;AAGG;;AAOH;;;AAGG;;AAOG;;;;AAoFN;AAoBA;;;AAGG;AACH;AAMA;AAaA;AAeA;AAOA;AAOA;AAeA;AASA;AA+BA;;;AAkFA;;;;AAiBD;;ACt2BD;AAQE;AAEA;;;;AAQA;AAEA;AAGA;;;;;;;;;;;;;;;;;AAG+C;;;;;;;;;;;;;;;;;AAGD;AAG9C;AAEA;;;AAgBA;;;AAMD;;AC1DD;AAeI;AACA;;;;;;;AADQ;;;;;AAoBX;;ACvCK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../context-dashboard/add-dashboard.component.ts","../../context-dashboard/add-dashboard.factory.ts","../../context-dashboard/context-dashboard.model.ts","../../context-dashboard/context-dashboard.service.ts","../../context-dashboard/dashboard-detail.service.ts","../../context-dashboard/dashboard-detail.component.ts","../../context-dashboard/memento/dashboard-originator.service.ts","../../context-dashboard/memento/dashboard-caretaker.service.ts","../../context-dashboard/memento/dashboard-edit-mode.service.ts","../../context-dashboard/widget.service.ts","../../context-dashboard/context-dashboard.component.ts","../../context-dashboard/widget-config/appearance-settings.component.ts","../../context-dashboard/type-dashboard-info/type-dashboard-info.component.ts","../../context-dashboard/widget-config/asset-property-mappings.model.ts","../../context-dashboard/widget-config.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.model.ts","../../context-dashboard/widget-config-hook/widget-config-hook.service.ts","../../context-dashboard/widget-config.service.ts","../../context-dashboard/widget-config/widget-config-root.component.ts","../../context-dashboard/widget-config.component.ts","../../context-dashboard/widget-config/widget-preview.component.ts","../../context-dashboard/widget-config/widget-config-section.component.ts","../../context-dashboard/widget-config/widget-preview-wrapper.component.ts","../../context-dashboard/paste-dashboard-action.component.ts","../../context-dashboard/context-dashboard.module.ts","../../context-dashboard/dashboard-action-bar.factory.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.component.ts","../../context-dashboard/device-info-dashboard/device-info-dashboard.module.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.component.ts","../../context-dashboard/device-management-home-dashboard/device-management-home-dashboard.module.ts","../../context-dashboard/widget-config/widget-config-appearance.component.ts","../../context-dashboard/widget-config/widget-config-general.component.ts","../../context-dashboard/widget-config/widget-asset-selector.component.ts","../../context-dashboard/new-dashboard.guard.ts","../../context-dashboard/widget-config/global-context-section.component.ts","../../context-dashboard/widget-config/widget-config-feedback.component.ts","../../context-dashboard/widget-config/asset-property-mappings.service.ts","../../context-dashboard/widget-config/asset-property-mappings.component.ts","../../context-dashboard/widget-config/asset-property-mappings.utils.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AAQI;AACA;AADQ;;;;AAoBX;;ACpBD;AACE;;;;AAMM;;AAoCP;;ACzCD;AACA;;;;;;;;;;;;;;;;;AAkBE;;AAEG;AACH;AACD;;AAGC;;;AAGG;;AAGH;;AAEG;;AAGH;;AAEG;AACH;AACE;;AAEG;AACH;;AAEF;;;AAGG;AACH;AACE;;AAEA;;AAEF;;;;;AAKG;AACH;AACA;;;;;;AAMG;AACH;AAEA;;AAEG;AACH;AACD;AAEK;;;AAGJ;AACD;;AAGC;AACA;AACA;AACA;AACA;AACA;AACA;AAAY;AAAwB;AACpC;AAAkB;AAAwB;AAC1C;AACA;AACA;AACA;AACA;;;AAGG;AACH;AACA;AACE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AAAmB;;AACpB;AACD;;AAEG;;AAED;;AAEG;;AAEH;;AAEG;AACH;AACA;;AAEG;AACH;AACA;;;;;;;;AAQG;AACH;AACE;AACA;AACA;AACA;AACD;AACD;;AAEG;;AAEJ;AAED;;;;;;;AAOA;;;AAGG;AACG;AACJ;;AAEG;;AAEH;;AAEG;AACH;AACA;;;;;;;;;;;;;AAaG;;AAKG;AACD;;AAKP;AACE;AACA;AACA;AACA;AACA;AAC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AAwBA;AAgBA;AAmDA;AAkCA;;;AAeD;;ACnKD;AAmBE;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMG;;AAIH;AACA;;AAEA;;AAGA;;;;;AAWA;;;;;AAWA;AAGA;AAIA;AACA;;AAEA;AACA;AAEA;AAEA;;;;;AAoIM;AAMA;;AAkBA;AAMN;AAaA;AAoBA;AAUA;AAKM;AAWA;AAkBN;;;AAcD;;ACtXD;;;;;;;;;AASG;AACH;AAoBA;AAIA;AACA;AAqBA;;;;;;;;;;;AAWG;AACH;;;"}
|
|
@@ -1011,7 +1011,7 @@ class AgentChatComponent {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
1013
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AgentChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1014
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: AgentChatComponent, isStandalone: true, selector: "c8y-agent-chat", inputs: { agent: { classPropertyName: "agent", publicName: "agent", isSignal: true, isRequired: true, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, chatConfig: { classPropertyName: "chatConfig", publicName: "chatConfig", isSignal: true, isRequired: false, transformFunction: null }, welcomeTemplate: { classPropertyName: "welcomeTemplate", publicName: "welcomeTemplate", isSignal: true, isRequired: false, transformFunction: null }, autoCreateAgents: { classPropertyName: "autoCreateAgents", publicName: "autoCreateAgents", isSignal: true, isRequired: false, transformFunction: null }, variables: { classPropertyName: "variables", publicName: "variables", isSignal: true, isRequired: false, transformFunction: null }, assistantMessageComponent: { classPropertyName: "assistantMessageComponent", publicName: "assistantMessageComponent", isSignal: true, isRequired: false, transformFunction: null }, assistantMessageDisplayConfig: { classPropertyName: "assistantMessageDisplayConfig", publicName: "assistantMessageDisplayConfig", isSignal: true, isRequired: false, transformFunction: null }, preprocessAgentMessage: { classPropertyName: "preprocessAgentMessage", publicName: "preprocessAgentMessage", isSignal: true, isRequired: false, transformFunction: null }, pruneMessagesForAgent: { classPropertyName: "pruneMessagesForAgent", publicName: "pruneMessagesForAgent", isSignal: true, isRequired: false, transformFunction: null }, skipHealthCheck: { classPropertyName: "skipHealthCheck", publicName: "skipHealthCheck", isSignal: true, isRequired: false, transformFunction: null }, initialChatHistory: { classPropertyName: "initialChatHistory", publicName: "initialChatHistory", isSignal: true, isRequired: false, transformFunction: null }, groundingContextProvider: { classPropertyName: "groundingContextProvider", publicName: "groundingContextProvider", isSignal: true, isRequired: false, transformFunction: null }, userAnalyticsContext: { classPropertyName: "userAnalyticsContext", publicName: "userAnalyticsContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onMessageFinish: "onMessageFinish", onToolResult: "onToolResult", onFeedback: "onFeedback", onMessagesChange: "onMessagesChange" }, viewQueries: [{ propertyName: "assistantMessageComponents", predicate: AiChatAssistantMessageComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@let agentHealthErrorMsg = _agentHealthError();\n@if (agentHealthErrorMsg) {\n @if (isLoadingAiResponse()) {\n <c8y-loading class=\"m-auto\"></c8y-loading>\n } @else {\n <c8y-ui-empty-state\n class=\"m-auto\"\n [icon]=\"'settings'\"\n [title]=\"'AI agent is not available.' | translate\"\n >\n <span>{{ agentHealthErrorMsg }}</span>\n\n @if (canCreate) {\n <div class=\"text-center m-t-16 m-b-16\">\n <button\n class=\"btn btn-primary\"\n (click)=\"createAgent()\"\n >\n {{ 'Create agent' | translate }}\n </button>\n </div>\n } @else {\n <p\n class=\"text-pre-wrap m-t-8\"\n data-cy=\"agent-health-detailed-messages\"\n >\n <small>{{ agentHealthDetailedMessages() }}</small>\n </p>\n }\n\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/ai\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n }\n}\n\n@if (!agentHealthErrorMsg) {\n <c8y-ai-chat\n (onMessage)=\"sendMessage($event)\"\n [isLoading]=\"isLoadingAiResponse()\"\n (onCancel)=\"cancel()\"\n [config]=\"chatConfig() ?? {}\"\n [prompt]=\"prompt\"\n [suggestionsTemplate]=\"suggestionsRef\"\n [welcomeTemplate]=\"welcomeTemplate()\"\n [cumulativeUsage]=\"cumulativeUsage()\"\n >\n @let messages$ = messages();\n @for (message of messages$; track $index; let i = $index) {\n <c8y-ai-chat-message [message]=\"message\">\n @if (message.role !== 'user' && model) {\n <!-- Visually hidden label included when users copy-paste from the chat, e.g. to report issues. It's quite helpful to know the model. -->\n <span\n class=\"hidden-copy-label\"\n aria-hidden=\"true\"\n >\n {{ `(Using model: ${model})` }}</span\n >\n }\n\n @if (message.role === 'user') {\n <div\n class=\"message-content\"\n data-cy=\"user-message-content\"\n [innerHTML]=\"message.content | markdownToHtml | async\"\n ></div>\n } @else if (\n message.role === 'assistant' && isLoadingAiResponse() && i === messages$.length - 1\n ) {\n <div>\n <!-- Last assistant message uses reactive computed context -->\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{ assistantMessageContext: lastAssistantMessageContext() }\"\n ></ng-container>\n </div>\n } @else {\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{\n assistantMessageContext: {\n message: message,\n config: assistantMessageDisplayConfig(),\n isMessageLoading: isLoadingAiResponse() && i === messages$.length - 1,\n messageDisplayIndex: messages$.length - 1 - i\n }\n }\"\n ></ng-container>\n }\n\n @let isLastMessage = i === messages$.length - 1;\n\n @if (message.role === 'user') {\n <c8y-ai-chat-message-action\n icon=\"pencil\"\n [tooltip]=\"'Edit and resend this message' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reprompt(message)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n i > 0 &&\n chatConfig()?.showUsagePerMessage &&\n message.usage\n ) {\n <c8y-ai-chat-message-action [custom]=\"true\">\n <span\n class=\"tag tag--info m-l-auto\"\n [tooltip]=\"\n 'Input tokens: {{ input }} \\nOutput tokens: {{ output }}'\n | translate\n : {\n input: message.usage.inputTokens || 0 | c8yNumber: 'floor' : '1.0-0',\n output: message.usage.outputTokens || 0 | c8yNumber: 'floor' : '1.0-0'\n }\n \"\n >\n {{ 'Tokens used: {{total}}' | translate: { total: message.usage.totalTokens || 0 |\n c8yNumber: 'floor' : '1.0-0' } }}\n </span>\n </c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-up\"\n [tooltip]=\"'This is useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, true)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-down\"\n [tooltip]=\"'This is not useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, false)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n !isLoadingAiResponse() &&\n chatConfig()?.showDeleteAction &&\n isLastMessage\n ) {\n <c8y-ai-chat-message-action\n icon=\"delete-bin\"\n [tooltip]=\"'Delete last exchange' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"deleteLastExchange()\"\n ></c8y-ai-chat-message-action>\n }\n\n <!-- Only allow regenerating the last message, otherwise we could be deleting a lot of useful message history -->\n @if (message.role === 'assistant' && i > 0 && isLastMessage && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"refresh\"\n [tooltip]=\"'Regenerate this response' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reload(message)\"\n ></c8y-ai-chat-message-action>\n }\n </c8y-ai-chat-message>\n }\n\n @let agentErrorMsg = agentRequestError();\n @if (agentErrorMsg) {\n <c8y-ai-chat-message [message]=\"{ role: 'assistant', content: agentErrorMsg }\">\n <div\n class=\"alert alert-danger d-flex a-i-center gap-8\"\n role=\"alert\"\n >\n <!-- Since errors come from the backend the only translation is for the fallback error message supplied by the UI. -->\n <div class=\"flex-grow text-pre-wrap\">{{ agentErrorMsg | translate }}</div>\n </div>\n </c8y-ai-chat-message>\n }\n\n <ng-template #suggestionsRef>\n @if (!isLoadingAiResponse()) {\n <!-- As soon as we have any suggestions (even empty) these take priority over what we restored from history -->\n @let activeSuggestions = suggestions() === undefined ? _restoredSuggestions : suggestions();\n @for (suggestion of activeSuggestions; track $index) {\n <c8y-ai-chat-suggestion\n [icon]=\"suggestion.icon || 'c8y-bulb'\"\n [useAiButtons]=\"true\"\n [prompt]=\"suggestion.prompt\"\n [label]=\"suggestion.label ?? suggestion.prompt\"\n (suggestionClicked)=\"sendMessage($event)\"\n [disabled]=\"isLoadingAiResponse()\"\n ></c8y-ai-chat-suggestion>\n }\n }\n </ng-template>\n </c8y-ai-chat>\n}\n", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-in-out{animation:fadeIn .2s ease-in}.fade-in-out.ng-leave-active{animation:fadeOut .2s ease-out}.hidden-copy-label{display:block;font-size:0;line-height:0;-webkit-user-select:text;user-select:text}\n"], dependencies: [{ kind: "component", type: AiChatComponent, selector: "c8y-ai-chat", inputs: ["isLoading", "disabled", "prompt", "suggestionsTemplate", "welcomeTemplate", "cumulativeUsage", "config"], outputs: ["onMessage", "onCancel"] }, { kind: "component", type: AiChatSuggestionComponent, selector: "c8y-ai-chat-suggestion", inputs: ["label", "prompt", "icon", "useAiButtons", "disabled"], outputs: ["suggestionClicked"] }, { kind: "component", type: AiChatMessageComponent, selector: "c8y-ai-chat-message", inputs: ["role", "message"] }, { kind: "component", type: AiChatMessageActionComponent, selector: "c8y-ai-chat-message-action", inputs: ["custom", "disabled", "tooltip", "icon"], outputs: ["actionClicked"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "ngmodule", type: CollapseModule }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: MarkdownToHtmlPipe, name: "markdownToHtml" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: NumberPipe, name: "c8yNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1014
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: AgentChatComponent, isStandalone: true, selector: "c8y-agent-chat", inputs: { agent: { classPropertyName: "agent", publicName: "agent", isSignal: true, isRequired: true, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, chatConfig: { classPropertyName: "chatConfig", publicName: "chatConfig", isSignal: true, isRequired: false, transformFunction: null }, welcomeTemplate: { classPropertyName: "welcomeTemplate", publicName: "welcomeTemplate", isSignal: true, isRequired: false, transformFunction: null }, autoCreateAgents: { classPropertyName: "autoCreateAgents", publicName: "autoCreateAgents", isSignal: true, isRequired: false, transformFunction: null }, variables: { classPropertyName: "variables", publicName: "variables", isSignal: true, isRequired: false, transformFunction: null }, assistantMessageComponent: { classPropertyName: "assistantMessageComponent", publicName: "assistantMessageComponent", isSignal: true, isRequired: false, transformFunction: null }, assistantMessageDisplayConfig: { classPropertyName: "assistantMessageDisplayConfig", publicName: "assistantMessageDisplayConfig", isSignal: true, isRequired: false, transformFunction: null }, preprocessAgentMessage: { classPropertyName: "preprocessAgentMessage", publicName: "preprocessAgentMessage", isSignal: true, isRequired: false, transformFunction: null }, pruneMessagesForAgent: { classPropertyName: "pruneMessagesForAgent", publicName: "pruneMessagesForAgent", isSignal: true, isRequired: false, transformFunction: null }, skipHealthCheck: { classPropertyName: "skipHealthCheck", publicName: "skipHealthCheck", isSignal: true, isRequired: false, transformFunction: null }, initialChatHistory: { classPropertyName: "initialChatHistory", publicName: "initialChatHistory", isSignal: true, isRequired: false, transformFunction: null }, groundingContextProvider: { classPropertyName: "groundingContextProvider", publicName: "groundingContextProvider", isSignal: true, isRequired: false, transformFunction: null }, userAnalyticsContext: { classPropertyName: "userAnalyticsContext", publicName: "userAnalyticsContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onMessageFinish: "onMessageFinish", onToolResult: "onToolResult", onFeedback: "onFeedback", onMessagesChange: "onMessagesChange" }, viewQueries: [{ propertyName: "assistantMessageComponents", predicate: AiChatAssistantMessageComponent, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "@let agentHealthErrorMsg = _agentHealthError();\n@if (agentHealthErrorMsg) {\n @if (isLoadingAiResponse()) {\n <c8y-loading class=\"m-auto\"></c8y-loading>\n } @else {\n <c8y-ui-empty-state\n class=\"m-auto\"\n [icon]=\"'settings'\"\n [title]=\"'AI agent is not available.' | translate\"\n >\n <span>{{ agentHealthErrorMsg }}</span>\n\n @if (canCreate) {\n <div class=\"text-center m-t-16 m-b-16\">\n <button\n class=\"btn btn-primary\"\n (click)=\"createAgent()\"\n >\n {{ 'Create agent' | translate }}\n </button>\n </div>\n } @else {\n <p\n class=\"text-pre-wrap m-t-8\"\n data-cy=\"agent-health-detailed-messages\"\n >\n <small>{{ agentHealthDetailedMessages() }}</small>\n </p>\n }\n\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/ai\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n }\n}\n\n@if (!agentHealthErrorMsg) {\n <c8y-ai-chat\n (onMessage)=\"sendMessage($event)\"\n [isLoading]=\"isLoadingAiResponse()\"\n (onCancel)=\"cancel()\"\n [config]=\"chatConfig() ?? {}\"\n [prompt]=\"prompt\"\n [suggestionsTemplate]=\"suggestionsRef\"\n [welcomeTemplate]=\"welcomeTemplate()\"\n [cumulativeUsage]=\"chatConfig()?.showCumulativeUsage ? cumulativeUsage() : null\"\n >\n @let messages$ = messages();\n @for (message of messages$; track $index; let i = $index) {\n <c8y-ai-chat-message [message]=\"message\">\n @if (message.role !== 'user' && model) {\n <!-- Visually hidden label included when users copy-paste from the chat, e.g. to report issues. It's quite helpful to know the model. -->\n <span\n class=\"hidden-copy-label\"\n aria-hidden=\"true\"\n >\n {{ `(Using model: ${model})` }}</span\n >\n }\n\n @if (message.role === 'user') {\n <div\n class=\"message-content\"\n data-cy=\"user-message-content\"\n [innerHTML]=\"message.content | markdownToHtml | async\"\n ></div>\n } @else if (\n message.role === 'assistant' && isLoadingAiResponse() && i === messages$.length - 1\n ) {\n <div>\n <!-- Last assistant message uses reactive computed context -->\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{ assistantMessageContext: lastAssistantMessageContext() }\"\n ></ng-container>\n </div>\n } @else {\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{\n assistantMessageContext: {\n message: message,\n config: assistantMessageDisplayConfig(),\n isMessageLoading: isLoadingAiResponse() && i === messages$.length - 1,\n messageDisplayIndex: messages$.length - 1 - i\n }\n }\"\n ></ng-container>\n }\n\n @let isLastMessage = i === messages$.length - 1;\n\n @if (message.role === 'user') {\n <c8y-ai-chat-message-action\n icon=\"pencil\"\n [tooltip]=\"'Edit and resend this message' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reprompt(message)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n i > 0 &&\n chatConfig()?.showUsagePerMessage &&\n message.usage\n ) {\n <c8y-ai-chat-message-action [custom]=\"true\">\n <span\n class=\"tag tag--info m-l-auto\"\n [tooltip]=\"\n 'Input tokens: {{ input }} \\nOutput tokens: {{ output }}'\n | translate\n : {\n input: message.usage.inputTokens || 0 | c8yNumber: 'floor' : '1.0-0',\n output: message.usage.outputTokens || 0 | c8yNumber: 'floor' : '1.0-0'\n }\n \"\n >\n {{ 'Tokens used: {{total}}' | translate: { total: message.usage.totalTokens || 0 |\n c8yNumber: 'floor' : '1.0-0' } }}\n </span>\n </c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-up\"\n [tooltip]=\"'This is useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, true)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-down\"\n [tooltip]=\"'This is not useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, false)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n !isLoadingAiResponse() &&\n chatConfig()?.showDeleteAction &&\n isLastMessage\n ) {\n <c8y-ai-chat-message-action\n icon=\"delete-bin\"\n [tooltip]=\"'Delete last exchange' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"deleteLastExchange()\"\n ></c8y-ai-chat-message-action>\n }\n\n <!-- Only allow regenerating the last message, otherwise we could be deleting a lot of useful message history -->\n @if (message.role === 'assistant' && i > 0 && isLastMessage && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"refresh\"\n [tooltip]=\"'Regenerate this response' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reload(message)\"\n ></c8y-ai-chat-message-action>\n }\n </c8y-ai-chat-message>\n }\n\n @let agentErrorMsg = agentRequestError();\n @if (agentErrorMsg) {\n <c8y-ai-chat-message [message]=\"{ role: 'assistant', content: agentErrorMsg }\">\n <div\n class=\"alert alert-danger d-flex a-i-center gap-8\"\n role=\"alert\"\n >\n <!-- Since errors come from the backend the only translation is for the fallback error message supplied by the UI. -->\n <div class=\"flex-grow text-pre-wrap\">{{ agentErrorMsg | translate }}</div>\n </div>\n </c8y-ai-chat-message>\n }\n\n <ng-template #suggestionsRef>\n @if (!isLoadingAiResponse()) {\n <!-- As soon as we have any suggestions (even empty) these take priority over what we restored from history -->\n @let activeSuggestions = suggestions() === undefined ? _restoredSuggestions : suggestions();\n @for (suggestion of activeSuggestions; track $index) {\n <c8y-ai-chat-suggestion\n [icon]=\"suggestion.icon || 'c8y-bulb'\"\n [useAiButtons]=\"true\"\n [prompt]=\"suggestion.prompt\"\n [label]=\"suggestion.label ?? suggestion.prompt\"\n (suggestionClicked)=\"sendMessage($event)\"\n [disabled]=\"isLoadingAiResponse()\"\n ></c8y-ai-chat-suggestion>\n }\n }\n </ng-template>\n </c8y-ai-chat>\n}\n", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-in-out{animation:fadeIn .2s ease-in}.fade-in-out.ng-leave-active{animation:fadeOut .2s ease-out}.hidden-copy-label{display:block;font-size:0;line-height:0;-webkit-user-select:text;user-select:text}\n"], dependencies: [{ kind: "component", type: AiChatComponent, selector: "c8y-ai-chat", inputs: ["isLoading", "disabled", "prompt", "suggestionsTemplate", "welcomeTemplate", "cumulativeUsage", "config"], outputs: ["onMessage", "onCancel"] }, { kind: "component", type: AiChatSuggestionComponent, selector: "c8y-ai-chat-suggestion", inputs: ["label", "prompt", "icon", "useAiButtons", "disabled"], outputs: ["suggestionClicked"] }, { kind: "component", type: AiChatMessageComponent, selector: "c8y-ai-chat-message", inputs: ["role", "message"] }, { kind: "component", type: AiChatMessageActionComponent, selector: "c8y-ai-chat-message-action", inputs: ["custom", "disabled", "tooltip", "icon"], outputs: ["actionClicked"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "ngmodule", type: CollapseModule }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: MarkdownToHtmlPipe, name: "markdownToHtml" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: NumberPipe, name: "c8yNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1015
1015
|
}
|
|
1016
1016
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: AgentChatComponent, decorators: [{
|
|
1017
1017
|
type: Component,
|
|
@@ -1032,7 +1032,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1032
1032
|
GuideHrefDirective,
|
|
1033
1033
|
TooltipModule,
|
|
1034
1034
|
NumberPipe
|
|
1035
|
-
], template: "@let agentHealthErrorMsg = _agentHealthError();\n@if (agentHealthErrorMsg) {\n @if (isLoadingAiResponse()) {\n <c8y-loading class=\"m-auto\"></c8y-loading>\n } @else {\n <c8y-ui-empty-state\n class=\"m-auto\"\n [icon]=\"'settings'\"\n [title]=\"'AI agent is not available.' | translate\"\n >\n <span>{{ agentHealthErrorMsg }}</span>\n\n @if (canCreate) {\n <div class=\"text-center m-t-16 m-b-16\">\n <button\n class=\"btn btn-primary\"\n (click)=\"createAgent()\"\n >\n {{ 'Create agent' | translate }}\n </button>\n </div>\n } @else {\n <p\n class=\"text-pre-wrap m-t-8\"\n data-cy=\"agent-health-detailed-messages\"\n >\n <small>{{ agentHealthDetailedMessages() }}</small>\n </p>\n }\n\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/ai\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n }\n}\n\n@if (!agentHealthErrorMsg) {\n <c8y-ai-chat\n (onMessage)=\"sendMessage($event)\"\n [isLoading]=\"isLoadingAiResponse()\"\n (onCancel)=\"cancel()\"\n [config]=\"chatConfig() ?? {}\"\n [prompt]=\"prompt\"\n [suggestionsTemplate]=\"suggestionsRef\"\n [welcomeTemplate]=\"welcomeTemplate()\"\n [cumulativeUsage]=\"cumulativeUsage()\"\n >\n @let messages$ = messages();\n @for (message of messages$; track $index; let i = $index) {\n <c8y-ai-chat-message [message]=\"message\">\n @if (message.role !== 'user' && model) {\n <!-- Visually hidden label included when users copy-paste from the chat, e.g. to report issues. It's quite helpful to know the model. -->\n <span\n class=\"hidden-copy-label\"\n aria-hidden=\"true\"\n >\n {{ `(Using model: ${model})` }}</span\n >\n }\n\n @if (message.role === 'user') {\n <div\n class=\"message-content\"\n data-cy=\"user-message-content\"\n [innerHTML]=\"message.content | markdownToHtml | async\"\n ></div>\n } @else if (\n message.role === 'assistant' && isLoadingAiResponse() && i === messages$.length - 1\n ) {\n <div>\n <!-- Last assistant message uses reactive computed context -->\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{ assistantMessageContext: lastAssistantMessageContext() }\"\n ></ng-container>\n </div>\n } @else {\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{\n assistantMessageContext: {\n message: message,\n config: assistantMessageDisplayConfig(),\n isMessageLoading: isLoadingAiResponse() && i === messages$.length - 1,\n messageDisplayIndex: messages$.length - 1 - i\n }\n }\"\n ></ng-container>\n }\n\n @let isLastMessage = i === messages$.length - 1;\n\n @if (message.role === 'user') {\n <c8y-ai-chat-message-action\n icon=\"pencil\"\n [tooltip]=\"'Edit and resend this message' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reprompt(message)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n i > 0 &&\n chatConfig()?.showUsagePerMessage &&\n message.usage\n ) {\n <c8y-ai-chat-message-action [custom]=\"true\">\n <span\n class=\"tag tag--info m-l-auto\"\n [tooltip]=\"\n 'Input tokens: {{ input }} \\nOutput tokens: {{ output }}'\n | translate\n : {\n input: message.usage.inputTokens || 0 | c8yNumber: 'floor' : '1.0-0',\n output: message.usage.outputTokens || 0 | c8yNumber: 'floor' : '1.0-0'\n }\n \"\n >\n {{ 'Tokens used: {{total}}' | translate: { total: message.usage.totalTokens || 0 |\n c8yNumber: 'floor' : '1.0-0' } }}\n </span>\n </c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-up\"\n [tooltip]=\"'This is useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, true)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-down\"\n [tooltip]=\"'This is not useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, false)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n !isLoadingAiResponse() &&\n chatConfig()?.showDeleteAction &&\n isLastMessage\n ) {\n <c8y-ai-chat-message-action\n icon=\"delete-bin\"\n [tooltip]=\"'Delete last exchange' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"deleteLastExchange()\"\n ></c8y-ai-chat-message-action>\n }\n\n <!-- Only allow regenerating the last message, otherwise we could be deleting a lot of useful message history -->\n @if (message.role === 'assistant' && i > 0 && isLastMessage && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"refresh\"\n [tooltip]=\"'Regenerate this response' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reload(message)\"\n ></c8y-ai-chat-message-action>\n }\n </c8y-ai-chat-message>\n }\n\n @let agentErrorMsg = agentRequestError();\n @if (agentErrorMsg) {\n <c8y-ai-chat-message [message]=\"{ role: 'assistant', content: agentErrorMsg }\">\n <div\n class=\"alert alert-danger d-flex a-i-center gap-8\"\n role=\"alert\"\n >\n <!-- Since errors come from the backend the only translation is for the fallback error message supplied by the UI. -->\n <div class=\"flex-grow text-pre-wrap\">{{ agentErrorMsg | translate }}</div>\n </div>\n </c8y-ai-chat-message>\n }\n\n <ng-template #suggestionsRef>\n @if (!isLoadingAiResponse()) {\n <!-- As soon as we have any suggestions (even empty) these take priority over what we restored from history -->\n @let activeSuggestions = suggestions() === undefined ? _restoredSuggestions : suggestions();\n @for (suggestion of activeSuggestions; track $index) {\n <c8y-ai-chat-suggestion\n [icon]=\"suggestion.icon || 'c8y-bulb'\"\n [useAiButtons]=\"true\"\n [prompt]=\"suggestion.prompt\"\n [label]=\"suggestion.label ?? suggestion.prompt\"\n (suggestionClicked)=\"sendMessage($event)\"\n [disabled]=\"isLoadingAiResponse()\"\n ></c8y-ai-chat-suggestion>\n }\n }\n </ng-template>\n </c8y-ai-chat>\n}\n", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-in-out{animation:fadeIn .2s ease-in}.fade-in-out.ng-leave-active{animation:fadeOut .2s ease-out}.hidden-copy-label{display:block;font-size:0;line-height:0;-webkit-user-select:text;user-select:text}\n"] }]
|
|
1035
|
+
], template: "@let agentHealthErrorMsg = _agentHealthError();\n@if (agentHealthErrorMsg) {\n @if (isLoadingAiResponse()) {\n <c8y-loading class=\"m-auto\"></c8y-loading>\n } @else {\n <c8y-ui-empty-state\n class=\"m-auto\"\n [icon]=\"'settings'\"\n [title]=\"'AI agent is not available.' | translate\"\n >\n <span>{{ agentHealthErrorMsg }}</span>\n\n @if (canCreate) {\n <div class=\"text-center m-t-16 m-b-16\">\n <button\n class=\"btn btn-primary\"\n (click)=\"createAgent()\"\n >\n {{ 'Create agent' | translate }}\n </button>\n </div>\n } @else {\n <p\n class=\"text-pre-wrap m-t-8\"\n data-cy=\"agent-health-detailed-messages\"\n >\n <small>{{ agentHealthDetailedMessages() }}</small>\n </p>\n }\n\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/ai\">user documentation</a>.\n </small>\n </p>\n </c8y-ui-empty-state>\n }\n}\n\n@if (!agentHealthErrorMsg) {\n <c8y-ai-chat\n (onMessage)=\"sendMessage($event)\"\n [isLoading]=\"isLoadingAiResponse()\"\n (onCancel)=\"cancel()\"\n [config]=\"chatConfig() ?? {}\"\n [prompt]=\"prompt\"\n [suggestionsTemplate]=\"suggestionsRef\"\n [welcomeTemplate]=\"welcomeTemplate()\"\n [cumulativeUsage]=\"chatConfig()?.showCumulativeUsage ? cumulativeUsage() : null\"\n >\n @let messages$ = messages();\n @for (message of messages$; track $index; let i = $index) {\n <c8y-ai-chat-message [message]=\"message\">\n @if (message.role !== 'user' && model) {\n <!-- Visually hidden label included when users copy-paste from the chat, e.g. to report issues. It's quite helpful to know the model. -->\n <span\n class=\"hidden-copy-label\"\n aria-hidden=\"true\"\n >\n {{ `(Using model: ${model})` }}</span\n >\n }\n\n @if (message.role === 'user') {\n <div\n class=\"message-content\"\n data-cy=\"user-message-content\"\n [innerHTML]=\"message.content | markdownToHtml | async\"\n ></div>\n } @else if (\n message.role === 'assistant' && isLoadingAiResponse() && i === messages$.length - 1\n ) {\n <div>\n <!-- Last assistant message uses reactive computed context -->\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{ assistantMessageContext: lastAssistantMessageContext() }\"\n ></ng-container>\n </div>\n } @else {\n <ng-container\n [ngComponentOutlet]=\"assistantMessageComponent()\"\n [ngComponentOutletInputs]=\"{\n assistantMessageContext: {\n message: message,\n config: assistantMessageDisplayConfig(),\n isMessageLoading: isLoadingAiResponse() && i === messages$.length - 1,\n messageDisplayIndex: messages$.length - 1 - i\n }\n }\"\n ></ng-container>\n }\n\n @let isLastMessage = i === messages$.length - 1;\n\n @if (message.role === 'user') {\n <c8y-ai-chat-message-action\n icon=\"pencil\"\n [tooltip]=\"'Edit and resend this message' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reprompt(message)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n i > 0 &&\n chatConfig()?.showUsagePerMessage &&\n message.usage\n ) {\n <c8y-ai-chat-message-action [custom]=\"true\">\n <span\n class=\"tag tag--info m-l-auto\"\n [tooltip]=\"\n 'Input tokens: {{ input }} \\nOutput tokens: {{ output }}'\n | translate\n : {\n input: message.usage.inputTokens || 0 | c8yNumber: 'floor' : '1.0-0',\n output: message.usage.outputTokens || 0 | c8yNumber: 'floor' : '1.0-0'\n }\n \"\n >\n {{ 'Tokens used: {{total}}' | translate: { total: message.usage.totalTokens || 0 |\n c8yNumber: 'floor' : '1.0-0' } }}\n </span>\n </c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-up\"\n [tooltip]=\"'This is useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, true)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (message.role === 'assistant' && i > 0 && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"thumbs-down\"\n [tooltip]=\"'This is not useful' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"rate(message, false)\"\n ></c8y-ai-chat-message-action>\n }\n\n @if (\n message.role === 'assistant' &&\n !isLoadingAiResponse() &&\n chatConfig()?.showDeleteAction &&\n isLastMessage\n ) {\n <c8y-ai-chat-message-action\n icon=\"delete-bin\"\n [tooltip]=\"'Delete last exchange' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"deleteLastExchange()\"\n ></c8y-ai-chat-message-action>\n }\n\n <!-- Only allow regenerating the last message, otherwise we could be deleting a lot of useful message history -->\n @if (message.role === 'assistant' && i > 0 && isLastMessage && !isLoadingAiResponse()) {\n <c8y-ai-chat-message-action\n icon=\"refresh\"\n [tooltip]=\"'Regenerate this response' | translate\"\n [disabled]=\"isLoadingAiResponse()\"\n (click)=\"reload(message)\"\n ></c8y-ai-chat-message-action>\n }\n </c8y-ai-chat-message>\n }\n\n @let agentErrorMsg = agentRequestError();\n @if (agentErrorMsg) {\n <c8y-ai-chat-message [message]=\"{ role: 'assistant', content: agentErrorMsg }\">\n <div\n class=\"alert alert-danger d-flex a-i-center gap-8\"\n role=\"alert\"\n >\n <!-- Since errors come from the backend the only translation is for the fallback error message supplied by the UI. -->\n <div class=\"flex-grow text-pre-wrap\">{{ agentErrorMsg | translate }}</div>\n </div>\n </c8y-ai-chat-message>\n }\n\n <ng-template #suggestionsRef>\n @if (!isLoadingAiResponse()) {\n <!-- As soon as we have any suggestions (even empty) these take priority over what we restored from history -->\n @let activeSuggestions = suggestions() === undefined ? _restoredSuggestions : suggestions();\n @for (suggestion of activeSuggestions; track $index) {\n <c8y-ai-chat-suggestion\n [icon]=\"suggestion.icon || 'c8y-bulb'\"\n [useAiButtons]=\"true\"\n [prompt]=\"suggestion.prompt\"\n [label]=\"suggestion.label ?? suggestion.prompt\"\n (suggestionClicked)=\"sendMessage($event)\"\n [disabled]=\"isLoadingAiResponse()\"\n ></c8y-ai-chat-suggestion>\n }\n }\n </ng-template>\n </c8y-ai-chat>\n}\n", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-in-out{animation:fadeIn .2s ease-in}.fade-in-out.ng-leave-active{animation:fadeOut .2s ease-out}.hidden-copy-label{display:block;font-size:0;line-height:0;-webkit-user-select:text;user-select:text}\n"] }]
|
|
1036
1036
|
}], propDecorators: { agent: [{ type: i0.Input, args: [{ isSignal: true, alias: "agent", required: true }] }], suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }], chatConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "chatConfig", required: false }] }], welcomeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "welcomeTemplate", required: false }] }], autoCreateAgents: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCreateAgents", required: false }] }], variables: [{ type: i0.Input, args: [{ isSignal: true, alias: "variables", required: false }] }], assistantMessageComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "assistantMessageComponent", required: false }] }], assistantMessageDisplayConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "assistantMessageDisplayConfig", required: false }] }], preprocessAgentMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "preprocessAgentMessage", required: false }] }], pruneMessagesForAgent: [{ type: i0.Input, args: [{ isSignal: true, alias: "pruneMessagesForAgent", required: false }] }], skipHealthCheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "skipHealthCheck", required: false }] }], initialChatHistory: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialChatHistory", required: false }] }], groundingContextProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "groundingContextProvider", required: false }] }], userAnalyticsContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "userAnalyticsContext", required: false }] }], onMessageFinish: [{ type: i0.Output, args: ["onMessageFinish"] }], onToolResult: [{ type: i0.Output, args: ["onToolResult"] }], onFeedback: [{ type: i0.Output, args: ["onFeedback"] }], onMessagesChange: [{ type: i0.Output, args: ["onMessagesChange"] }], assistantMessageComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => AiChatAssistantMessageComponent), { isSignal: true }] }] } });
|
|
1037
1037
|
|
|
1038
1038
|
class WidgetAiChatSectionComponent {
|