@kwirthmagnify/kwirth-common-ai 0.5.57 → 0.5.58

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/back.d.ts CHANGED
@@ -74,10 +74,53 @@ export interface IK8sCapability {
74
74
  appsApi: AppsV1Api;
75
75
  networkApi: NetworkingV1Api;
76
76
  }
77
+ export interface IMetricsPodSample {
78
+ podRef?: {
79
+ name?: string;
80
+ namespace?: string;
81
+ };
82
+ cpu?: {
83
+ usageNanoCores?: number;
84
+ };
85
+ memory?: {
86
+ workingSetBytes?: number;
87
+ };
88
+ }
89
+ export interface IMetricsNodeSample {
90
+ name?: string;
91
+ timestamp?: number;
92
+ summary?: {
93
+ cpu?: {
94
+ usageNanoCores?: number;
95
+ };
96
+ memory?: {
97
+ workingSetBytes?: number;
98
+ };
99
+ network?: {
100
+ rxBytes?: number;
101
+ txBytes?: number;
102
+ };
103
+ pods?: IMetricsPodSample[];
104
+ };
105
+ }
106
+ export interface IMetricsSample {
107
+ /** Segundos entre lecturas. Sin esto, una serie de numeros no dice a que ritmo pasa el tiempo. */
108
+ metricsInterval?: number;
109
+ cluster: {
110
+ vcpus: number;
111
+ memory: number;
112
+ /** Porcentajes, 0-100. */
113
+ cpuUsage: number;
114
+ memoryUsage: number;
115
+ txmbps: number;
116
+ rxmbps: number;
117
+ };
118
+ nodes: IMetricsNodeSample[];
119
+ }
77
120
  /** Metricas del cluster (`ECapability.METRICS`). */
78
121
  export interface IMetricsCapability {
79
- /** Muestras de metricas que el core mantiene en memoria. */
80
- samples: unknown[];
122
+ /** Muestras que el core mantiene en memoria. La mas reciente, al final. */
123
+ samples: IMetricsSample[];
81
124
  }
82
125
  /**
83
126
  * Un elemento del buffer de eventos del core: el tipo de cambio y el objeto tal y como vino de la API.
package/dist/back.js CHANGED
@@ -469,7 +469,7 @@ const buildToolHost = (requires, context) => {
469
469
  };
470
470
  }
471
471
  if (requires.includes(index_1.ECapability.METRICS))
472
- host.metrics = { samples: (_a = context.clusterMetrics) !== null && _a !== void 0 ? _a : [] };
472
+ host.metrics = { samples: ((_a = context.clusterMetrics) !== null && _a !== void 0 ? _a : []) };
473
473
  if (requires.includes(index_1.ECapability.EVENTS))
474
474
  host.events = { recent: ((_b = context.clusterEvents) !== null && _b !== void 0 ? _b : []) };
475
475
  if (requires.includes(index_1.ECapability.REPOS))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-ai",
3
- "version": "0.5.57",
3
+ "version": "0.5.58",
4
4
  "description": "Shared AI/LLM types and utilities for Kwirth AI plugins",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q 2>nul & tsc",