@etm-professional-control/winccoa-mcp-server 1.3.2 → 1.5.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/.env.example +8 -1
- package/LEGAL_INFO.md +47 -0
- package/LICENSE.md +21 -0
- package/OSS.md +178 -0
- package/README.md +62 -7
- package/build/config/demo-project-instructions.md +28 -0
- package/build/config/server.config.d.ts +16 -1
- package/build/config/server.config.d.ts.map +1 -1
- package/build/config/server.config.js +60 -10
- package/build/config/server.config.js.map +1 -1
- package/build/fields/default.md +50 -0
- package/build/fields/oil.md +46 -0
- package/build/fields/transport.md +70 -0
- package/build/helpers/drivers/MqttConnection.d.ts +113 -0
- package/build/helpers/drivers/MqttConnection.d.ts.map +1 -0
- package/build/helpers/drivers/MqttConnection.js +644 -0
- package/build/helpers/drivers/MqttConnection.js.map +1 -0
- package/build/helpers/pmon/PmonClient.d.ts.map +1 -1
- package/build/helpers/pmon/PmonClient.js +53 -27
- package/build/helpers/pmon/PmonClient.js.map +1 -1
- package/build/index_http.d.ts +14 -1
- package/build/index_http.d.ts.map +1 -1
- package/build/index_http.js +122 -45
- package/build/index_http.js.map +1 -1
- package/build/server.d.ts +38 -4
- package/build/server.d.ts.map +1 -1
- package/build/server.js +192 -142
- package/build/server.js.map +1 -1
- package/build/systemprompt.md +50 -0
- package/build/tool_loader.d.ts.map +1 -1
- package/build/tool_loader.js +18 -4
- package/build/tool_loader.js.map +1 -1
- package/build/tools/common/common_query.d.ts.map +1 -1
- package/build/tools/common/common_query.js +49 -32
- package/build/tools/common/common_query.js.map +1 -1
- package/build/tools/dashboards/widget.d.ts.map +1 -1
- package/build/tools/dashboards/widget.js +12 -2
- package/build/tools/dashboards/widget.js.map +1 -1
- package/build/tools/datapoints/dp_basic.d.ts.map +1 -1
- package/build/tools/datapoints/dp_basic.js +48 -0
- package/build/tools/datapoints/dp_basic.js.map +1 -1
- package/build/tools/datapoints/dp_types.d.ts.map +1 -1
- package/build/tools/datapoints/dp_types.js +16 -1
- package/build/tools/datapoints/dp_types.js.map +1 -1
- package/build/tools/mqtt/mqtt_connection.d.ts +14 -0
- package/build/tools/mqtt/mqtt_connection.d.ts.map +1 -0
- package/build/tools/mqtt/mqtt_connection.js +380 -0
- package/build/tools/mqtt/mqtt_connection.js.map +1 -0
- package/build/types/drivers/connection.d.ts +36 -53
- package/build/types/drivers/connection.d.ts.map +1 -1
- package/build/types/drivers/connection.js +38 -31
- package/build/types/drivers/connection.js.map +1 -1
- package/build/types/drivers/mqtt.d.ts +253 -0
- package/build/types/drivers/mqtt.d.ts.map +1 -0
- package/build/types/drivers/mqtt.js +142 -0
- package/build/types/drivers/mqtt.js.map +1 -0
- package/build/types/drivers/opcua.d.ts +62 -0
- package/build/types/drivers/opcua.d.ts.map +1 -0
- package/build/types/drivers/opcua.js +41 -0
- package/build/types/drivers/opcua.js.map +1 -0
- package/build/types/drivers/{browse.d.ts → opcua_browse.d.ts} +1 -1
- package/build/types/drivers/opcua_browse.d.ts.map +1 -0
- package/build/types/drivers/{browse.js → opcua_browse.js} +1 -1
- package/build/types/drivers/opcua_browse.js.map +1 -0
- package/build/types/index.d.ts +3 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +6 -2
- package/build/types/index.js.map +1 -1
- package/build/utils/logger.d.ts +29 -0
- package/build/utils/logger.d.ts.map +1 -0
- package/build/utils/logger.js +56 -0
- package/build/utils/logger.js.map +1 -0
- package/package.json +83 -71
- package/sbom.json +5541 -0
- package/build/types/drivers/browse.d.ts.map +0 -1
- package/build/types/drivers/browse.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Oil & Gas Industry Instructions
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This configuration applies to WinCC OA systems used in Oil & Gas production, refining, and distribution facilities.
|
|
5
|
+
|
|
6
|
+
## Safety Requirements
|
|
7
|
+
- **CRITICAL**: Never modify safety-critical datapoints without explicit authorization
|
|
8
|
+
- All changes to production systems require validation and confirmation
|
|
9
|
+
- Emergency shutdown systems are strictly read-only
|
|
10
|
+
- Interlock conditions must be verified before any process modifications
|
|
11
|
+
|
|
12
|
+
## Operational Limits
|
|
13
|
+
- **Flow rates**: 0-1000 m³/h (validate against pipe capacity)
|
|
14
|
+
- **Pressure**: Maximum 100 bar (safety valve at 110 bar)
|
|
15
|
+
- **Temperature**: -20°C to +80°C operational range
|
|
16
|
+
- **Valve positions**: 0-100% (check for intermediate restrictions)
|
|
17
|
+
|
|
18
|
+
## Process Control Rules
|
|
19
|
+
1. **Before changing flow rates**:
|
|
20
|
+
- Verify upstream and downstream pressures
|
|
21
|
+
- Check valve positions in the flow path
|
|
22
|
+
- Confirm tank levels are within limits
|
|
23
|
+
|
|
24
|
+
2. **Recipe Management**:
|
|
25
|
+
- Recipe percentages represent VALVE POSITIONS, not volume percentages
|
|
26
|
+
- Material consumption = (valve_position/100) × flow_rate × time
|
|
27
|
+
- Always validate total consumption against target volume
|
|
28
|
+
|
|
29
|
+
3. **Cascade Control**:
|
|
30
|
+
- Changes to master controllers affect all slaves
|
|
31
|
+
- Verify slave controller limits before modifying master setpoints
|
|
32
|
+
|
|
33
|
+
## Alarm Management
|
|
34
|
+
- Critical alarms (Priority 1-2) require immediate operator attention
|
|
35
|
+
- Do not suppress alarms without proper authorization
|
|
36
|
+
- Alarm limits should only be modified through approved change management
|
|
37
|
+
|
|
38
|
+
## Integration Points
|
|
39
|
+
- OPC UA nodes under `ns=2;s=Production/*` are production critical
|
|
40
|
+
- Modbus registers 40001-40100 contain safety interlocks
|
|
41
|
+
- SQL historian updates every 10 seconds for trending data
|
|
42
|
+
|
|
43
|
+
## Compliance Notes
|
|
44
|
+
- All changes are logged for regulatory compliance
|
|
45
|
+
- Maintain audit trail for production setpoint modifications
|
|
46
|
+
- Environmental limits must be respected at all times
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Transportation Systems Instructions
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This configuration applies to WinCC OA systems used in transportation infrastructure including rail, traffic management, and logistics systems.
|
|
5
|
+
|
|
6
|
+
## Safety Critical Systems
|
|
7
|
+
- **Emergency Stop Systems**: Absolutely read-only, no modifications allowed
|
|
8
|
+
- **Signal Interlocking**: Changes must respect interlocking logic
|
|
9
|
+
- **Track Switching**: Requires coordination with dispatch systems
|
|
10
|
+
- **Platform Safety**: Door and barrier systems have strict sequencing
|
|
11
|
+
|
|
12
|
+
## Traffic Signal Management
|
|
13
|
+
- Signal states must follow proper sequencing (RED → RED+YELLOW → GREEN → YELLOW → RED)
|
|
14
|
+
- Pedestrian crossings have priority during their active phase
|
|
15
|
+
- Conflicting movements must be interlocked
|
|
16
|
+
- Emergency vehicle preemption overrides normal operation
|
|
17
|
+
|
|
18
|
+
## Operational Rules
|
|
19
|
+
|
|
20
|
+
### Rail Systems
|
|
21
|
+
1. **Track Switching**:
|
|
22
|
+
- Verify no train in section before switching
|
|
23
|
+
- Check signal aspects match intended route
|
|
24
|
+
- Confirm switch position feedback
|
|
25
|
+
|
|
26
|
+
2. **Signal Control**:
|
|
27
|
+
- Maintain safe braking distances
|
|
28
|
+
- Respect block occupancy
|
|
29
|
+
- Follow fail-safe principles (default to stop)
|
|
30
|
+
|
|
31
|
+
### Traffic Management
|
|
32
|
+
1. **Intersection Control**:
|
|
33
|
+
- Minimum green times must be respected
|
|
34
|
+
- Yellow phase duration based on approach speed
|
|
35
|
+
- All-red clearance intervals are mandatory
|
|
36
|
+
|
|
37
|
+
2. **Adaptive Control**:
|
|
38
|
+
- Queue detectors influence timing
|
|
39
|
+
- Bus/tram priority requires validation
|
|
40
|
+
- Network coordination maintains green waves
|
|
41
|
+
|
|
42
|
+
## Communication Systems
|
|
43
|
+
- CCTV systems are monitor-only unless specifically designated
|
|
44
|
+
- Variable message signs require approved messages
|
|
45
|
+
- PA systems have zone-based authorization
|
|
46
|
+
|
|
47
|
+
## Scheduling Integration
|
|
48
|
+
- Timetable systems are authoritative for planned movements
|
|
49
|
+
- Real-time adjustments must consider knock-on effects
|
|
50
|
+
- Passenger information systems update automatically
|
|
51
|
+
|
|
52
|
+
## Data Recording
|
|
53
|
+
- All control actions are logged with timestamp and operator
|
|
54
|
+
- Video recording retention follows legal requirements
|
|
55
|
+
- Incident data preserved for investigation
|
|
56
|
+
|
|
57
|
+
## Maintenance Mode
|
|
58
|
+
- Maintenance overrides require special authorization
|
|
59
|
+
- Test modes must not affect live operations
|
|
60
|
+
- Return to normal operation requires verification
|
|
61
|
+
|
|
62
|
+
## Environmental Considerations
|
|
63
|
+
- Weather stations may trigger speed restrictions
|
|
64
|
+
- Ice/snow detection affects signal timing
|
|
65
|
+
- Wind sensors can close bridges/tunnels
|
|
66
|
+
|
|
67
|
+
## Integration Protocols
|
|
68
|
+
- IEC 61850 for substation automation
|
|
69
|
+
- NTCIP for traffic devices
|
|
70
|
+
- RaSTA for safety-critical rail communication
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MQTT Connection Manager
|
|
3
|
+
*
|
|
4
|
+
* Provides functionality to create, configure, and manage MQTT connections in WinCC OA.
|
|
5
|
+
* Based on WinCC OA _MqttConnection internal datapoint structure.
|
|
6
|
+
*/
|
|
7
|
+
import { BaseConnection } from './BaseConnection.js';
|
|
8
|
+
import type { MqttConnectionConfig, MqttAddressParams } from '../../types/index.js';
|
|
9
|
+
import { MqttConnectionState } from '../../types/index.js';
|
|
10
|
+
export { MqttConnectionType, MqttConnectionState, MqttProtocolVersion, MqttSslVersion, MqttQoS, MqttAddressDirection, MqttTransformation, MQTT_DEFAULTS } from '../../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* MQTT Connection Manager Class
|
|
13
|
+
*
|
|
14
|
+
* Extends BaseConnection with MQTT-specific functionality.
|
|
15
|
+
*/
|
|
16
|
+
export declare class MqttConnection extends BaseConnection {
|
|
17
|
+
/**
|
|
18
|
+
* Generate a unique connection name for MQTT
|
|
19
|
+
* @returns Connection name in format _MqttConnection<n>
|
|
20
|
+
*/
|
|
21
|
+
generateConnectionName(): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Get available MQTT driver numbers from Pmon
|
|
24
|
+
* Similar to CTRL paMqttCheckDrvNums()
|
|
25
|
+
* @returns Array of MQTT driver numbers, sorted ascending
|
|
26
|
+
*/
|
|
27
|
+
getMqttDriverNumbers(): Promise<number[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Get all used driver numbers (MQTT, simulation, other drivers)
|
|
30
|
+
* @returns Array of used driver numbers
|
|
31
|
+
*/
|
|
32
|
+
getUsedDriverNumbers(): Promise<number[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the lowest available MQTT driver number (avoiding sim driver conflicts)
|
|
35
|
+
* @returns Lowest available driver number for MQTT
|
|
36
|
+
*/
|
|
37
|
+
getDefaultMqttDriverNumber(): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Ensure MQTT driver with specified number is running
|
|
40
|
+
* Creates and starts the driver if it doesn't exist
|
|
41
|
+
* @param managerNumber - The driver number to ensure
|
|
42
|
+
* @returns Object with success status and optional warnings
|
|
43
|
+
*/
|
|
44
|
+
ensureMqttDriverRunning(managerNumber: number): Promise<{
|
|
45
|
+
success: boolean;
|
|
46
|
+
error?: string;
|
|
47
|
+
warnings?: string[];
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Build the JSON address string for Config.Address
|
|
51
|
+
* This is the format stored in _MqttConnection.Config.Address
|
|
52
|
+
* Required keys: Username, ConnectionType, ConnectionString, Certificate, Password, Identity, PSK
|
|
53
|
+
*/
|
|
54
|
+
private buildAddressJson;
|
|
55
|
+
/**
|
|
56
|
+
* Add a new MQTT connection
|
|
57
|
+
*
|
|
58
|
+
* @param config - MQTT connection configuration
|
|
59
|
+
* @returns Object with success status, connection name, and any errors
|
|
60
|
+
*/
|
|
61
|
+
addConnection(config: MqttConnectionConfig): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
connectionName?: string;
|
|
64
|
+
error?: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete an MQTT connection
|
|
68
|
+
*
|
|
69
|
+
* @param connectionName - Name of the connection to delete (with or without leading _)
|
|
70
|
+
* @returns Object with success status and any errors
|
|
71
|
+
*/
|
|
72
|
+
deleteConnection(connectionName: string): Promise<{
|
|
73
|
+
success: boolean;
|
|
74
|
+
error?: string;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Get the connection state of an MQTT connection
|
|
78
|
+
*
|
|
79
|
+
* @param connectionName - Name of the connection
|
|
80
|
+
* @returns Connection state or error
|
|
81
|
+
*/
|
|
82
|
+
getConnectionState(connectionName: string): Promise<{
|
|
83
|
+
success: boolean;
|
|
84
|
+
state?: MqttConnectionState;
|
|
85
|
+
stateText?: string;
|
|
86
|
+
error?: string;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* List all MQTT connections
|
|
90
|
+
*
|
|
91
|
+
* @returns Array of connection names and their states
|
|
92
|
+
*/
|
|
93
|
+
listConnections(): Promise<{
|
|
94
|
+
success: boolean;
|
|
95
|
+
connections?: Array<{
|
|
96
|
+
name: string;
|
|
97
|
+
state: MqttConnectionState;
|
|
98
|
+
stateText: string;
|
|
99
|
+
connectionString?: string;
|
|
100
|
+
}>;
|
|
101
|
+
error?: string;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Configure address settings for a datapoint (peripheral address)
|
|
105
|
+
* Implementation of abstract method from BaseConnection
|
|
106
|
+
*
|
|
107
|
+
* @param params - MQTT address parameters
|
|
108
|
+
* @returns true on success
|
|
109
|
+
* @throws Error with detailed message on failure
|
|
110
|
+
*/
|
|
111
|
+
addAddressConfig(params: MqttAddressParams): Promise<boolean>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=MqttConnection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MqttConnection.d.ts","sourceRoot":"","sources":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