@qontinui/ui-bridge 0.1.1
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/dist/control/index.d.mts +134 -0
- package/dist/control/index.d.ts +134 -0
- package/dist/control/index.js +924 -0
- package/dist/control/index.js.map +1 -0
- package/dist/control/index.mjs +919 -0
- package/dist/control/index.mjs.map +1 -0
- package/dist/core/index.d.mts +52 -0
- package/dist/core/index.d.ts +52 -0
- package/dist/core/index.js +1424 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +1409 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/debug/index.d.mts +93 -0
- package/dist/debug/index.d.ts +93 -0
- package/dist/debug/index.js +673 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/index.mjs +664 -0
- package/dist/debug/index.mjs.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +4719 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4665 -0
- package/dist/index.mjs.map +1 -0
- package/dist/metrics-BCG7z7Aq.d.mts +147 -0
- package/dist/metrics-QCnK0EFw.d.ts +147 -0
- package/dist/react/index.d.mts +786 -0
- package/dist/react/index.d.ts +786 -0
- package/dist/react/index.js +4312 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/index.mjs +4290 -0
- package/dist/react/index.mjs.map +1 -0
- package/dist/registry-CT6BVVKr.d.mts +253 -0
- package/dist/registry-D4mQ01B3.d.ts +253 -0
- package/dist/render-log/index.d.mts +340 -0
- package/dist/render-log/index.d.ts +340 -0
- package/dist/render-log/index.js +702 -0
- package/dist/render-log/index.js.map +1 -0
- package/dist/render-log/index.mjs +695 -0
- package/dist/render-log/index.mjs.map +1 -0
- package/dist/types-BDkXy5si.d.ts +354 -0
- package/dist/types-BpvpStn3.d.mts +802 -0
- package/dist/types-BpvpStn3.d.ts +802 -0
- package/dist/types-DdJD9yw5.d.mts +354 -0
- package/dist/websocket-client-B2LC9CYc.d.mts +124 -0
- package/dist/websocket-client-DupH0X7B.d.ts +124 -0
- package/package.json +83 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { c as BridgeEvent } from './types-BpvpStn3.mjs';
|
|
2
|
+
import { c as ControlActionResponse, a as ComponentActionResponse, m as WorkflowStepResult } from './types-DdJD9yw5.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Metrics Module
|
|
6
|
+
*
|
|
7
|
+
* Performance metrics and action history tracking.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Action history entry
|
|
12
|
+
*/
|
|
13
|
+
interface ActionHistoryEntry {
|
|
14
|
+
/** Unique entry ID */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Timestamp */
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/** Action type */
|
|
19
|
+
type: 'element' | 'component' | 'workflow-step';
|
|
20
|
+
/** Target ID */
|
|
21
|
+
target: string;
|
|
22
|
+
/** Action name */
|
|
23
|
+
action: string;
|
|
24
|
+
/** Whether the action succeeded */
|
|
25
|
+
success: boolean;
|
|
26
|
+
/** Duration in milliseconds */
|
|
27
|
+
durationMs: number;
|
|
28
|
+
/** Error message if failed */
|
|
29
|
+
error?: string;
|
|
30
|
+
/** Action parameters */
|
|
31
|
+
params?: Record<string, unknown>;
|
|
32
|
+
/** Response data */
|
|
33
|
+
response?: unknown;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Performance metrics
|
|
37
|
+
*/
|
|
38
|
+
interface PerformanceMetrics {
|
|
39
|
+
/** Total actions executed */
|
|
40
|
+
totalActions: number;
|
|
41
|
+
/** Successful actions */
|
|
42
|
+
successfulActions: number;
|
|
43
|
+
/** Failed actions */
|
|
44
|
+
failedActions: number;
|
|
45
|
+
/** Success rate (0-1) */
|
|
46
|
+
successRate: number;
|
|
47
|
+
/** Average action duration */
|
|
48
|
+
avgDurationMs: number;
|
|
49
|
+
/** Minimum action duration */
|
|
50
|
+
minDurationMs: number;
|
|
51
|
+
/** Maximum action duration */
|
|
52
|
+
maxDurationMs: number;
|
|
53
|
+
/** 95th percentile duration */
|
|
54
|
+
p95DurationMs: number;
|
|
55
|
+
/** Actions per second (last minute) */
|
|
56
|
+
actionsPerSecond: number;
|
|
57
|
+
/** Errors by type */
|
|
58
|
+
errorsByType: Record<string, number>;
|
|
59
|
+
/** Actions by type */
|
|
60
|
+
actionsByType: Record<string, number>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Metrics collector options
|
|
64
|
+
*/
|
|
65
|
+
interface MetricsCollectorOptions {
|
|
66
|
+
/** Maximum history entries to keep */
|
|
67
|
+
maxHistoryEntries?: number;
|
|
68
|
+
/** Window for rate calculations (ms) */
|
|
69
|
+
rateWindow?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Metrics collector
|
|
73
|
+
*
|
|
74
|
+
* Collects and aggregates performance metrics.
|
|
75
|
+
*/
|
|
76
|
+
declare class MetricsCollector {
|
|
77
|
+
private history;
|
|
78
|
+
private maxHistoryEntries;
|
|
79
|
+
private rateWindow;
|
|
80
|
+
constructor(options?: MetricsCollectorOptions);
|
|
81
|
+
/**
|
|
82
|
+
* Record an element action
|
|
83
|
+
*/
|
|
84
|
+
recordElementAction(target: string, action: string, response: ControlActionResponse, params?: Record<string, unknown>): ActionHistoryEntry;
|
|
85
|
+
/**
|
|
86
|
+
* Record a component action
|
|
87
|
+
*/
|
|
88
|
+
recordComponentAction(target: string, action: string, response: ComponentActionResponse, params?: Record<string, unknown>): ActionHistoryEntry;
|
|
89
|
+
/**
|
|
90
|
+
* Record a workflow step
|
|
91
|
+
*/
|
|
92
|
+
recordWorkflowStep(workflowId: string, result: WorkflowStepResult): ActionHistoryEntry;
|
|
93
|
+
/**
|
|
94
|
+
* Record from a bridge event
|
|
95
|
+
*/
|
|
96
|
+
recordEvent(event: BridgeEvent): void;
|
|
97
|
+
/**
|
|
98
|
+
* Get action history
|
|
99
|
+
*/
|
|
100
|
+
getHistory(options?: {
|
|
101
|
+
type?: 'element' | 'component' | 'workflow-step';
|
|
102
|
+
target?: string;
|
|
103
|
+
action?: string;
|
|
104
|
+
success?: boolean;
|
|
105
|
+
since?: number;
|
|
106
|
+
limit?: number;
|
|
107
|
+
}): ActionHistoryEntry[];
|
|
108
|
+
/**
|
|
109
|
+
* Get performance metrics
|
|
110
|
+
*/
|
|
111
|
+
getMetrics(since?: number): PerformanceMetrics;
|
|
112
|
+
/**
|
|
113
|
+
* Get recent errors
|
|
114
|
+
*/
|
|
115
|
+
getRecentErrors(limit?: number): ActionHistoryEntry[];
|
|
116
|
+
/**
|
|
117
|
+
* Get slowest actions
|
|
118
|
+
*/
|
|
119
|
+
getSlowestActions(limit?: number): ActionHistoryEntry[];
|
|
120
|
+
/**
|
|
121
|
+
* Clear history
|
|
122
|
+
*/
|
|
123
|
+
clearHistory(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Export history as JSON
|
|
126
|
+
*/
|
|
127
|
+
exportHistory(): string;
|
|
128
|
+
/**
|
|
129
|
+
* Import history from JSON
|
|
130
|
+
*/
|
|
131
|
+
importHistory(json: string): void;
|
|
132
|
+
private addEntry;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a metrics collector
|
|
136
|
+
*/
|
|
137
|
+
declare function createMetricsCollector(options?: MetricsCollectorOptions): MetricsCollector;
|
|
138
|
+
/**
|
|
139
|
+
* Format duration for display
|
|
140
|
+
*/
|
|
141
|
+
declare function formatDuration(ms: number): string;
|
|
142
|
+
/**
|
|
143
|
+
* Format percentage for display
|
|
144
|
+
*/
|
|
145
|
+
declare function formatPercentage(value: number): string;
|
|
146
|
+
|
|
147
|
+
export { type ActionHistoryEntry as A, MetricsCollector as M, type PerformanceMetrics as P, type MetricsCollectorOptions as a, formatPercentage as b, createMetricsCollector as c, formatDuration as f };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { c as BridgeEvent } from './types-BpvpStn3.js';
|
|
2
|
+
import { c as ControlActionResponse, a as ComponentActionResponse, m as WorkflowStepResult } from './types-BDkXy5si.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Metrics Module
|
|
6
|
+
*
|
|
7
|
+
* Performance metrics and action history tracking.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Action history entry
|
|
12
|
+
*/
|
|
13
|
+
interface ActionHistoryEntry {
|
|
14
|
+
/** Unique entry ID */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Timestamp */
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/** Action type */
|
|
19
|
+
type: 'element' | 'component' | 'workflow-step';
|
|
20
|
+
/** Target ID */
|
|
21
|
+
target: string;
|
|
22
|
+
/** Action name */
|
|
23
|
+
action: string;
|
|
24
|
+
/** Whether the action succeeded */
|
|
25
|
+
success: boolean;
|
|
26
|
+
/** Duration in milliseconds */
|
|
27
|
+
durationMs: number;
|
|
28
|
+
/** Error message if failed */
|
|
29
|
+
error?: string;
|
|
30
|
+
/** Action parameters */
|
|
31
|
+
params?: Record<string, unknown>;
|
|
32
|
+
/** Response data */
|
|
33
|
+
response?: unknown;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Performance metrics
|
|
37
|
+
*/
|
|
38
|
+
interface PerformanceMetrics {
|
|
39
|
+
/** Total actions executed */
|
|
40
|
+
totalActions: number;
|
|
41
|
+
/** Successful actions */
|
|
42
|
+
successfulActions: number;
|
|
43
|
+
/** Failed actions */
|
|
44
|
+
failedActions: number;
|
|
45
|
+
/** Success rate (0-1) */
|
|
46
|
+
successRate: number;
|
|
47
|
+
/** Average action duration */
|
|
48
|
+
avgDurationMs: number;
|
|
49
|
+
/** Minimum action duration */
|
|
50
|
+
minDurationMs: number;
|
|
51
|
+
/** Maximum action duration */
|
|
52
|
+
maxDurationMs: number;
|
|
53
|
+
/** 95th percentile duration */
|
|
54
|
+
p95DurationMs: number;
|
|
55
|
+
/** Actions per second (last minute) */
|
|
56
|
+
actionsPerSecond: number;
|
|
57
|
+
/** Errors by type */
|
|
58
|
+
errorsByType: Record<string, number>;
|
|
59
|
+
/** Actions by type */
|
|
60
|
+
actionsByType: Record<string, number>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Metrics collector options
|
|
64
|
+
*/
|
|
65
|
+
interface MetricsCollectorOptions {
|
|
66
|
+
/** Maximum history entries to keep */
|
|
67
|
+
maxHistoryEntries?: number;
|
|
68
|
+
/** Window for rate calculations (ms) */
|
|
69
|
+
rateWindow?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Metrics collector
|
|
73
|
+
*
|
|
74
|
+
* Collects and aggregates performance metrics.
|
|
75
|
+
*/
|
|
76
|
+
declare class MetricsCollector {
|
|
77
|
+
private history;
|
|
78
|
+
private maxHistoryEntries;
|
|
79
|
+
private rateWindow;
|
|
80
|
+
constructor(options?: MetricsCollectorOptions);
|
|
81
|
+
/**
|
|
82
|
+
* Record an element action
|
|
83
|
+
*/
|
|
84
|
+
recordElementAction(target: string, action: string, response: ControlActionResponse, params?: Record<string, unknown>): ActionHistoryEntry;
|
|
85
|
+
/**
|
|
86
|
+
* Record a component action
|
|
87
|
+
*/
|
|
88
|
+
recordComponentAction(target: string, action: string, response: ComponentActionResponse, params?: Record<string, unknown>): ActionHistoryEntry;
|
|
89
|
+
/**
|
|
90
|
+
* Record a workflow step
|
|
91
|
+
*/
|
|
92
|
+
recordWorkflowStep(workflowId: string, result: WorkflowStepResult): ActionHistoryEntry;
|
|
93
|
+
/**
|
|
94
|
+
* Record from a bridge event
|
|
95
|
+
*/
|
|
96
|
+
recordEvent(event: BridgeEvent): void;
|
|
97
|
+
/**
|
|
98
|
+
* Get action history
|
|
99
|
+
*/
|
|
100
|
+
getHistory(options?: {
|
|
101
|
+
type?: 'element' | 'component' | 'workflow-step';
|
|
102
|
+
target?: string;
|
|
103
|
+
action?: string;
|
|
104
|
+
success?: boolean;
|
|
105
|
+
since?: number;
|
|
106
|
+
limit?: number;
|
|
107
|
+
}): ActionHistoryEntry[];
|
|
108
|
+
/**
|
|
109
|
+
* Get performance metrics
|
|
110
|
+
*/
|
|
111
|
+
getMetrics(since?: number): PerformanceMetrics;
|
|
112
|
+
/**
|
|
113
|
+
* Get recent errors
|
|
114
|
+
*/
|
|
115
|
+
getRecentErrors(limit?: number): ActionHistoryEntry[];
|
|
116
|
+
/**
|
|
117
|
+
* Get slowest actions
|
|
118
|
+
*/
|
|
119
|
+
getSlowestActions(limit?: number): ActionHistoryEntry[];
|
|
120
|
+
/**
|
|
121
|
+
* Clear history
|
|
122
|
+
*/
|
|
123
|
+
clearHistory(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Export history as JSON
|
|
126
|
+
*/
|
|
127
|
+
exportHistory(): string;
|
|
128
|
+
/**
|
|
129
|
+
* Import history from JSON
|
|
130
|
+
*/
|
|
131
|
+
importHistory(json: string): void;
|
|
132
|
+
private addEntry;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a metrics collector
|
|
136
|
+
*/
|
|
137
|
+
declare function createMetricsCollector(options?: MetricsCollectorOptions): MetricsCollector;
|
|
138
|
+
/**
|
|
139
|
+
* Format duration for display
|
|
140
|
+
*/
|
|
141
|
+
declare function formatDuration(ms: number): string;
|
|
142
|
+
/**
|
|
143
|
+
* Format percentage for display
|
|
144
|
+
*/
|
|
145
|
+
declare function formatPercentage(value: number): string;
|
|
146
|
+
|
|
147
|
+
export { type ActionHistoryEntry as A, MetricsCollector as M, type PerformanceMetrics as P, type MetricsCollectorOptions as a, formatPercentage as b, createMetricsCollector as c, formatDuration as f };
|