@kwirthmagnify/kwirth-common-ai 0.5.61 → 0.5.63
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 +76 -691
- package/dist/back.js +84 -1182
- package/dist/front.js +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +20 -20
- package/package.json +1 -1
package/dist/back.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ILlm, ILlmProvider,
|
|
2
|
-
import type { AppsV1Api, CoreV1Api, NetworkingV1Api } from '@kubernetes/client-node';
|
|
1
|
+
import { ILlm, ILlmProvider, ECapability, EToolEffect, EToolSensitivity, IAiToolInfo, IAiToolsetInfo, IToolsetConfig } from './index';
|
|
2
|
+
import type { AppsV1Api, CoreV1Api, CustomObjectsApi, NetworkingV1Api } from '@kubernetes/client-node';
|
|
3
3
|
interface ILogChannel {
|
|
4
4
|
logInfo?: (msg: string) => void;
|
|
5
5
|
logWarning?: (msg: string) => void;
|
|
6
6
|
logError?: (msg: string) => void;
|
|
7
7
|
}
|
|
8
|
-
import { LanguageModel,
|
|
8
|
+
import { LanguageModel, ToolSet } from 'ai';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
export declare const buildModel: (llm: ILlm, providers: ILlmProvider[]) => LanguageModel | null;
|
|
11
11
|
export interface IVisionResult<T> {
|
|
@@ -49,31 +49,32 @@ export interface IToolContext {
|
|
|
49
49
|
trace: (toolName: string, args: Record<string, unknown>) => void;
|
|
50
50
|
}
|
|
51
51
|
export { EToolEffect } from './index';
|
|
52
|
-
export interface IToolInfo {
|
|
53
|
-
name: string;
|
|
54
|
-
description: string;
|
|
55
|
-
effect: EToolEffect;
|
|
56
|
-
}
|
|
57
52
|
export declare const runWithToolContext: <T>(context: IToolContext, fn: () => Promise<T>) => Promise<T>;
|
|
58
|
-
/**
|
|
53
|
+
/** A cluster node, as a tool sees it. Compatible with the core's `INodeInfo`. */
|
|
59
54
|
export interface IK8sNodeInfo {
|
|
60
55
|
name: string;
|
|
61
56
|
ip: string;
|
|
62
57
|
maxPods: number;
|
|
63
58
|
}
|
|
64
|
-
/**
|
|
59
|
+
/** Access to Kubernetes (`ECapability.K8S`). */
|
|
65
60
|
export interface IK8sCapability {
|
|
66
|
-
/**
|
|
61
|
+
/** Cluster name, as Kwirth knows it. */
|
|
67
62
|
name: string;
|
|
68
|
-
/**
|
|
63
|
+
/** Detected flavour: aks, eks, gke, k3s, k3d… */
|
|
69
64
|
flavour: string;
|
|
70
65
|
vcpus: number;
|
|
71
|
-
/**
|
|
66
|
+
/** Total cluster memory, in bytes. */
|
|
72
67
|
memory: number;
|
|
73
68
|
nodes: Map<string, IK8sNodeInfo>;
|
|
74
69
|
coreApi: CoreV1Api;
|
|
75
70
|
appsApi: AppsV1Api;
|
|
76
71
|
networkApi: NetworkingV1Api;
|
|
72
|
+
/**
|
|
73
|
+
* Custom resources. The three typed APIs above only reach built-in kinds, so without this a toolset
|
|
74
|
+
* cannot read a single CRD -- and that is where whole products live: Fleet, Kubewarden, Longhorn,
|
|
75
|
+
* Trivy. The core already builds this client at startup; it simply was not being lent.
|
|
76
|
+
*/
|
|
77
|
+
crdApi: CustomObjectsApi;
|
|
77
78
|
}
|
|
78
79
|
export interface IMetricsPodSample {
|
|
79
80
|
podRef?: {
|
|
@@ -105,12 +106,12 @@ export interface IMetricsNodeSample {
|
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
export interface IMetricsSample {
|
|
108
|
-
/**
|
|
109
|
+
/** Seconds between readings. Without it, a series of numbers says nothing about how fast time passes. */
|
|
109
110
|
metricsInterval?: number;
|
|
110
111
|
cluster: {
|
|
111
112
|
vcpus: number;
|
|
112
113
|
memory: number;
|
|
113
|
-
/**
|
|
114
|
+
/** Percentages, 0-100. */
|
|
114
115
|
cpuUsage: number;
|
|
115
116
|
memoryUsage: number;
|
|
116
117
|
txmbps: number;
|
|
@@ -118,60 +119,61 @@ export interface IMetricsSample {
|
|
|
118
119
|
};
|
|
119
120
|
nodes: IMetricsNodeSample[];
|
|
120
121
|
}
|
|
121
|
-
/**
|
|
122
|
+
/** Cluster metrics (`ECapability.METRICS`). */
|
|
122
123
|
export interface IMetricsCapability {
|
|
123
|
-
/**
|
|
124
|
+
/** Samples the core keeps in memory. The most recent one last. */
|
|
124
125
|
samples: IMetricsSample[];
|
|
125
126
|
}
|
|
126
127
|
/**
|
|
127
|
-
*
|
|
128
|
-
* `obj`
|
|
129
|
-
*
|
|
128
|
+
* One entry of the core's event buffer: the kind of change and the object exactly as it came from the API.
|
|
129
|
+
* `obj` is left generic on purpose — kube Events and objects of any kind fit in there — but typed as an
|
|
130
|
+
* object rather than as `any`: whoever reads it must check `kind` before believing anything.
|
|
130
131
|
*/
|
|
131
132
|
export interface IClusterEvent {
|
|
132
|
-
/** ADDED | MODIFIED | DELETED
|
|
133
|
+
/** ADDED | MODIFIED | DELETED for object changes; kube Events travel through here too. */
|
|
133
134
|
type?: string;
|
|
134
135
|
obj?: Record<string, any>;
|
|
135
136
|
}
|
|
136
|
-
/**
|
|
137
|
+
/** Recent cluster events (`ECapability.EVENTS`). */
|
|
137
138
|
export interface IEventsCapability {
|
|
138
|
-
/** Buffer
|
|
139
|
+
/** Buffer the core keeps accumulating. The most recent one last. */
|
|
139
140
|
recent: IClusterEvent[];
|
|
140
141
|
}
|
|
141
|
-
/**
|
|
142
|
+
/** Source repository credentials (`ECapability.REPOS`). */
|
|
142
143
|
export interface IReposCapability {
|
|
143
144
|
creds: ISourceRepoCred[];
|
|
144
145
|
}
|
|
145
146
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
147
|
+
* What a tool receives when it runs. Only the capabilities its toolset declared come filled in:
|
|
148
|
+
* a `requires: []` receives nothing but `trace`.
|
|
148
149
|
*/
|
|
149
150
|
export interface IToolHost {
|
|
150
|
-
/**
|
|
151
|
+
/** Records the invocation. NOT a capability: it is always lent, and never declared. */
|
|
151
152
|
trace: (toolName: string, args: Record<string, unknown>) => void;
|
|
152
153
|
k8s?: IK8sCapability;
|
|
153
154
|
metrics?: IMetricsCapability;
|
|
154
155
|
events?: IEventsCapability;
|
|
155
156
|
repos?: IReposCapability;
|
|
156
157
|
}
|
|
157
|
-
/**
|
|
158
|
+
/** An executable tool: what travels to the front end (IAiToolInfo) plus what it takes to invoke it. */
|
|
158
159
|
export interface IAiTool extends IAiToolInfo {
|
|
159
160
|
inputSchema: z.ZodTypeAny;
|
|
160
161
|
execute: (args: Record<string, unknown>, host: IToolHost) => Promise<unknown>;
|
|
161
162
|
}
|
|
162
|
-
/**
|
|
163
|
+
/** An executable toolset: its descriptor (IAiToolsetInfo) with the real tools inside. */
|
|
163
164
|
export interface IAiToolset extends Omit<IAiToolsetInfo, 'tools'> {
|
|
164
165
|
tools: IAiTool[];
|
|
165
166
|
}
|
|
166
167
|
/**
|
|
167
|
-
*
|
|
168
|
+
* Declares a tool, inferring the type of its arguments FROM its own `inputSchema`.
|
|
168
169
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* no
|
|
170
|
+
* Without this, `execute` receives `Record<string, unknown>` and every tool fills up with
|
|
171
|
+
* `String(args.namespace)` and loose casts: thirty tools like that are thirty places to go wrong in
|
|
172
|
+
* silence, with no help from the compiler. With this, the schema is the single source of truth and `args`
|
|
173
|
+
* arrives typed.
|
|
172
174
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
+
* The registry still stores the loose type (`IAiTool`): whoever invokes it does not know the schema, and
|
|
176
|
+
* there the check is done by zod at run time, as it should be.
|
|
175
177
|
*/
|
|
176
178
|
export declare const defineTool: <S extends z.ZodTypeAny>(definition: {
|
|
177
179
|
name: string;
|
|
@@ -182,82 +184,82 @@ export declare const defineTool: <S extends z.ZodTypeAny>(definition: {
|
|
|
182
184
|
execute: (args: z.infer<S>, host: IToolHost) => Promise<unknown>;
|
|
183
185
|
}) => IAiTool;
|
|
184
186
|
export declare const isBuiltInToolsetId: (id: string) => boolean;
|
|
185
|
-
/**
|
|
187
|
+
/** Grants a toolset to a list of plugins. Replaces the previous grant; `[]` takes it away from everyone. */
|
|
186
188
|
export declare const setToolsetGrants: (toolsetId: string, pluginIds: string[]) => void;
|
|
187
|
-
/**
|
|
189
|
+
/** Who a toolset is granted to. Empty = nobody, which is the default state. */
|
|
188
190
|
export declare const getToolsetGrants: (toolsetId: string) => string[];
|
|
189
|
-
/**
|
|
191
|
+
/** Whether THAT plugin may use THAT toolset. */
|
|
190
192
|
export declare const isToolsetGrantedTo: (toolsetId: string, pluginId: string) => boolean;
|
|
191
193
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
194
|
+
* Registers a toolset. `builtIn` is only used by the core for its own: it marks the id as reserved.
|
|
195
|
+
* Throws if the id is already taken — registering the same id twice is a packaging error, not something
|
|
196
|
+
* to be resolved silently by overwriting the first one.
|
|
195
197
|
*/
|
|
196
198
|
export declare const registerToolset: (toolset: IAiToolset, builtIn?: boolean) => void;
|
|
197
|
-
/**
|
|
199
|
+
/** Removes a toolset from the registry (uninstall). Built-in ones are never removed. */
|
|
198
200
|
export declare const unregisterToolset: (id: string) => boolean;
|
|
199
201
|
export declare const getToolset: (id: string) => IAiToolset | undefined;
|
|
200
202
|
export declare const listToolsets: () => IAiToolset[];
|
|
201
|
-
/**
|
|
203
|
+
/** What is sent to the front end: the descriptors, without inputSchema or execute. */
|
|
202
204
|
export declare const listToolsetInfos: () => IAiToolsetInfo[];
|
|
203
205
|
/**
|
|
204
|
-
*
|
|
206
|
+
* Builds a toolset's host from the core context, provisioning ONLY what was declared.
|
|
205
207
|
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
208
|
+
* Doing the handing-out here and not at each call site is what makes the `ECapability` promise keepable:
|
|
209
|
+
* if every site assembled its own object, one of them being too generous would be enough for the
|
|
210
|
+
* declaration to stop meaning anything.
|
|
209
211
|
*/
|
|
210
212
|
export declare const buildToolHost: (requires: ECapability[], context: IToolContext) => IToolHost;
|
|
211
213
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
+
* Invokes a tool by its qualified reference. A single invocation path for built-in and installed alike,
|
|
215
|
+
* with the host built according to the `requires` of ITS toolset.
|
|
214
216
|
*/
|
|
215
217
|
export declare const invokeToolRef: (ref: string, args: Record<string, unknown>, context: IToolContext) => Promise<unknown>;
|
|
216
|
-
/**
|
|
218
|
+
/** Resolves a qualified reference '<toolset>/<tool>' against the registry. */
|
|
217
219
|
export declare const resolveToolRef: (ref: string) => {
|
|
218
220
|
toolset: IAiToolset;
|
|
219
221
|
tool: IAiTool;
|
|
220
222
|
} | undefined;
|
|
221
|
-
/**
|
|
223
|
+
/** A tool that IS offered to the model. */
|
|
222
224
|
export interface IEffectiveTool {
|
|
223
|
-
/**
|
|
225
|
+
/** The short name: what travels to the LLM. */
|
|
224
226
|
name: string;
|
|
225
|
-
/**
|
|
227
|
+
/** The qualified reference: what gets persisted. */
|
|
226
228
|
ref: string;
|
|
227
229
|
toolsetId: string;
|
|
228
230
|
tool: IAiTool;
|
|
229
231
|
}
|
|
230
|
-
/**
|
|
232
|
+
/** A tool that exists but is NOT offered, because a toolset with higher precedence carries that name. */
|
|
231
233
|
export interface IShadowedTool {
|
|
232
234
|
name: string;
|
|
233
235
|
ref: string;
|
|
234
236
|
toolsetId: string;
|
|
235
|
-
/**
|
|
237
|
+
/** Who shadows it. The editor must say so: otherwise turning this one off looks like it does something. */
|
|
236
238
|
shadowedBy: string;
|
|
237
239
|
}
|
|
238
240
|
export interface IToolResolution {
|
|
239
241
|
effective: IEffectiveTool[];
|
|
240
242
|
shadowed: IShadowedTool[];
|
|
241
|
-
/**
|
|
243
|
+
/** Assigned toolsets that are not registered (uninstalled, or never installed). */
|
|
242
244
|
missing: string[];
|
|
243
245
|
/**
|
|
244
|
-
* Toolsets
|
|
246
|
+
* Toolsets that ARE installed but have not been granted to this plugin.
|
|
245
247
|
*
|
|
246
|
-
*
|
|
247
|
-
* "
|
|
248
|
-
*
|
|
248
|
+
* Reported apart from `missing` on purpose: "it is not installed" the admin fixes by installing it, and
|
|
249
|
+
* "it has not been granted to you" the admin fixes by granting it. Lumping them together sends the admin
|
|
250
|
+
* looking in the wrong place.
|
|
249
251
|
*/
|
|
250
252
|
notGranted: string[];
|
|
251
253
|
}
|
|
252
254
|
/**
|
|
253
|
-
*
|
|
254
|
-
* editor
|
|
255
|
+
* Applies a client's ceiling over the registry. Pure: it neither executes nor touches the context, so the
|
|
256
|
+
* editor can call it to DRAW exactly what is going to run.
|
|
255
257
|
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
+
* A disabled tool does not shadow: what gets disabled is a concrete reference ('ts1/td'), not a name, so if
|
|
259
|
+
* `ts1/td` is off and `ts2` carries another `td`, the one from `ts2` surfaces.
|
|
258
260
|
*/
|
|
259
261
|
export declare const resolveTools: (config: IToolsetConfig, requesterId?: string) => IToolResolution;
|
|
260
|
-
/**
|
|
262
|
+
/** One concrete invocation, as the two hooks see it. */
|
|
261
263
|
export interface IToolInvocation {
|
|
262
264
|
ref: string;
|
|
263
265
|
toolsetId: string;
|
|
@@ -266,649 +268,34 @@ export interface IToolInvocation {
|
|
|
266
268
|
}
|
|
267
269
|
export interface IToolAuthorization {
|
|
268
270
|
allowed: boolean;
|
|
269
|
-
/**
|
|
271
|
+
/** Why not. It travels to the model, so it is written so the model can decide otherwise. */
|
|
270
272
|
reason?: string;
|
|
271
273
|
}
|
|
272
|
-
/**
|
|
274
|
+
/** How an invocation ended. `ms` included: a slow tool is a problem even when it returns correctly. */
|
|
273
275
|
export interface IToolOutcome {
|
|
274
276
|
ok: boolean;
|
|
275
277
|
result?: unknown;
|
|
276
278
|
error?: string;
|
|
277
279
|
ms: number;
|
|
278
|
-
/**
|
|
280
|
+
/** Whether it never ran at all, because of the authorisation hook. */
|
|
279
281
|
denied?: boolean;
|
|
280
282
|
}
|
|
281
283
|
export interface IAgentToolHooks {
|
|
282
|
-
/**
|
|
284
|
+
/** BEFORE running. With no hook, everything is allowed: today the ceiling is the selection (S4 fills it). */
|
|
283
285
|
authorize?: (invocation: IToolInvocation, tool: IAiTool) => IToolAuthorization | Promise<IToolAuthorization>;
|
|
284
|
-
/**
|
|
286
|
+
/** AFTER, whatever happened. It cannot break the invocation (S6 fills it). */
|
|
285
287
|
observe?: (invocation: IToolInvocation, outcome: IToolOutcome) => void;
|
|
286
288
|
}
|
|
287
289
|
/**
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
+
* The tools ready to hand to the AI SDK, already resolved by precedence and with both hooks in place.
|
|
291
|
+
* The object key is the SHORT name, which is the only thing the provider accepts.
|
|
290
292
|
*/
|
|
291
293
|
export declare const buildAgentTools: (config: IToolsetConfig, context: IToolContext, hooks?: IAgentToolHooks,
|
|
292
294
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
+
* Who is asking for the tools. Without it nothing is filtered by grant, so a plugin MUST pass its id:
|
|
296
|
+
* that is what stops it from serving itself a toolset it was never granted.
|
|
295
297
|
*/
|
|
296
298
|
requesterId?: string) => ToolSet;
|
|
297
|
-
export declare const tools: {
|
|
298
|
-
readonly list_namespaces: Tool<Record<string, never>, {
|
|
299
|
-
namespaces: any;
|
|
300
|
-
error?: undefined;
|
|
301
|
-
} | {
|
|
302
|
-
error: any;
|
|
303
|
-
namespaces?: undefined;
|
|
304
|
-
}>;
|
|
305
|
-
readonly get_node_data: Tool<Record<string, never>, any>;
|
|
306
|
-
readonly get_cluster_data: Tool<Record<string, never>, {
|
|
307
|
-
name: any;
|
|
308
|
-
flavour: any;
|
|
309
|
-
vcpus: any;
|
|
310
|
-
memoryGB: number;
|
|
311
|
-
nodeCount: any;
|
|
312
|
-
nodes: any;
|
|
313
|
-
error?: undefined;
|
|
314
|
-
} | {
|
|
315
|
-
error: any;
|
|
316
|
-
name?: undefined;
|
|
317
|
-
flavour?: undefined;
|
|
318
|
-
vcpus?: undefined;
|
|
319
|
-
memoryGB?: undefined;
|
|
320
|
-
nodeCount?: undefined;
|
|
321
|
-
nodes?: undefined;
|
|
322
|
-
}>;
|
|
323
|
-
readonly get_workload_data: Tool<{
|
|
324
|
-
namespace?: string | undefined;
|
|
325
|
-
}, {
|
|
326
|
-
deployments: any;
|
|
327
|
-
statefulSets: any;
|
|
328
|
-
daemonSets: any;
|
|
329
|
-
pods: any;
|
|
330
|
-
services: any;
|
|
331
|
-
error?: undefined;
|
|
332
|
-
} | {
|
|
333
|
-
error: any;
|
|
334
|
-
deployments?: undefined;
|
|
335
|
-
statefulSets?: undefined;
|
|
336
|
-
daemonSets?: undefined;
|
|
337
|
-
pods?: undefined;
|
|
338
|
-
services?: undefined;
|
|
339
|
-
}>;
|
|
340
|
-
readonly get_space_data: Tool<{
|
|
341
|
-
namespace: string;
|
|
342
|
-
}, {
|
|
343
|
-
namespace: string;
|
|
344
|
-
status: any;
|
|
345
|
-
labels: any;
|
|
346
|
-
resourceQuotas: any;
|
|
347
|
-
limitRanges: any;
|
|
348
|
-
pods: any;
|
|
349
|
-
deployments: any;
|
|
350
|
-
services: any;
|
|
351
|
-
configMaps: any;
|
|
352
|
-
error?: undefined;
|
|
353
|
-
} | {
|
|
354
|
-
error: any;
|
|
355
|
-
namespace?: undefined;
|
|
356
|
-
status?: undefined;
|
|
357
|
-
labels?: undefined;
|
|
358
|
-
resourceQuotas?: undefined;
|
|
359
|
-
limitRanges?: undefined;
|
|
360
|
-
pods?: undefined;
|
|
361
|
-
deployments?: undefined;
|
|
362
|
-
services?: undefined;
|
|
363
|
-
configMaps?: undefined;
|
|
364
|
-
}>;
|
|
365
|
-
readonly get_namespace_yaml: Tool<{
|
|
366
|
-
name: string;
|
|
367
|
-
}, any>;
|
|
368
|
-
readonly describe_service: Tool<{
|
|
369
|
-
namespace: string;
|
|
370
|
-
name: string;
|
|
371
|
-
}, {
|
|
372
|
-
name: string;
|
|
373
|
-
namespace: string;
|
|
374
|
-
type: any;
|
|
375
|
-
clusterIP: any;
|
|
376
|
-
externalIPs: any;
|
|
377
|
-
loadBalancer: any;
|
|
378
|
-
sessionAffinity: any;
|
|
379
|
-
selector: any;
|
|
380
|
-
ports: any;
|
|
381
|
-
endpoints: any;
|
|
382
|
-
endpointCount: any;
|
|
383
|
-
error?: undefined;
|
|
384
|
-
} | {
|
|
385
|
-
error: any;
|
|
386
|
-
name?: undefined;
|
|
387
|
-
namespace?: undefined;
|
|
388
|
-
type?: undefined;
|
|
389
|
-
clusterIP?: undefined;
|
|
390
|
-
externalIPs?: undefined;
|
|
391
|
-
loadBalancer?: undefined;
|
|
392
|
-
sessionAffinity?: undefined;
|
|
393
|
-
selector?: undefined;
|
|
394
|
-
ports?: undefined;
|
|
395
|
-
endpoints?: undefined;
|
|
396
|
-
endpointCount?: undefined;
|
|
397
|
-
}>;
|
|
398
|
-
readonly describe_ingress: Tool<{
|
|
399
|
-
namespace: string;
|
|
400
|
-
name: string;
|
|
401
|
-
}, {
|
|
402
|
-
name: string;
|
|
403
|
-
namespace: string;
|
|
404
|
-
ingressClass: any;
|
|
405
|
-
defaultBackend: string | undefined;
|
|
406
|
-
rules: any;
|
|
407
|
-
tls: any;
|
|
408
|
-
loadBalancer: any;
|
|
409
|
-
error?: undefined;
|
|
410
|
-
} | {
|
|
411
|
-
error: any;
|
|
412
|
-
name?: undefined;
|
|
413
|
-
namespace?: undefined;
|
|
414
|
-
ingressClass?: undefined;
|
|
415
|
-
defaultBackend?: undefined;
|
|
416
|
-
rules?: undefined;
|
|
417
|
-
tls?: undefined;
|
|
418
|
-
loadBalancer?: undefined;
|
|
419
|
-
}>;
|
|
420
|
-
readonly describe_controller: Tool<{
|
|
421
|
-
namespace: string;
|
|
422
|
-
kind: "Deployment" | "StatefulSet" | "DaemonSet" | "ReplicaSet";
|
|
423
|
-
name: string;
|
|
424
|
-
}, {
|
|
425
|
-
kind: "Deployment" | "StatefulSet" | "DaemonSet" | "ReplicaSet";
|
|
426
|
-
name: string;
|
|
427
|
-
namespace: string;
|
|
428
|
-
replicas: {
|
|
429
|
-
desired: any;
|
|
430
|
-
current: any;
|
|
431
|
-
ready: any;
|
|
432
|
-
available: any;
|
|
433
|
-
updated: any;
|
|
434
|
-
} | {
|
|
435
|
-
desired: any;
|
|
436
|
-
ready: any;
|
|
437
|
-
available: any;
|
|
438
|
-
updated: any;
|
|
439
|
-
current?: undefined;
|
|
440
|
-
};
|
|
441
|
-
strategy: any;
|
|
442
|
-
conditions: any;
|
|
443
|
-
selector: any;
|
|
444
|
-
template: {
|
|
445
|
-
containers: any;
|
|
446
|
-
initContainers: any;
|
|
447
|
-
serviceAccount: any;
|
|
448
|
-
};
|
|
449
|
-
error?: undefined;
|
|
450
|
-
} | {
|
|
451
|
-
error: any;
|
|
452
|
-
kind?: undefined;
|
|
453
|
-
name?: undefined;
|
|
454
|
-
namespace?: undefined;
|
|
455
|
-
replicas?: undefined;
|
|
456
|
-
strategy?: undefined;
|
|
457
|
-
conditions?: undefined;
|
|
458
|
-
selector?: undefined;
|
|
459
|
-
template?: undefined;
|
|
460
|
-
}>;
|
|
461
|
-
readonly get_service_yaml: Tool<{
|
|
462
|
-
namespace: string;
|
|
463
|
-
name: string;
|
|
464
|
-
}, any>;
|
|
465
|
-
readonly list_services: Tool<{
|
|
466
|
-
namespace?: string | undefined;
|
|
467
|
-
}, {
|
|
468
|
-
services: any;
|
|
469
|
-
error?: undefined;
|
|
470
|
-
} | {
|
|
471
|
-
error: any;
|
|
472
|
-
services?: undefined;
|
|
473
|
-
}>;
|
|
474
|
-
readonly list_ingresses: Tool<{
|
|
475
|
-
namespace?: string | undefined;
|
|
476
|
-
}, {
|
|
477
|
-
ingresses: any;
|
|
478
|
-
error?: undefined;
|
|
479
|
-
} | {
|
|
480
|
-
error: any;
|
|
481
|
-
ingresses?: undefined;
|
|
482
|
-
}>;
|
|
483
|
-
readonly get_ingress_yaml: Tool<{
|
|
484
|
-
namespace: string;
|
|
485
|
-
name: string;
|
|
486
|
-
}, any>;
|
|
487
|
-
readonly get_cluster_usage: Tool<Record<string, never>, {
|
|
488
|
-
error: string;
|
|
489
|
-
vcpus?: undefined;
|
|
490
|
-
memoryGB?: undefined;
|
|
491
|
-
cpuUsagePercent?: undefined;
|
|
492
|
-
memoryUsagePercent?: undefined;
|
|
493
|
-
networkTxMbps?: undefined;
|
|
494
|
-
networkRxMbps?: undefined;
|
|
495
|
-
metricsIntervalSeconds?: undefined;
|
|
496
|
-
} | {
|
|
497
|
-
vcpus: any;
|
|
498
|
-
memoryGB: number;
|
|
499
|
-
cpuUsagePercent: number;
|
|
500
|
-
memoryUsagePercent: number;
|
|
501
|
-
networkTxMbps: number;
|
|
502
|
-
networkRxMbps: number;
|
|
503
|
-
metricsIntervalSeconds: any;
|
|
504
|
-
error?: undefined;
|
|
505
|
-
}>;
|
|
506
|
-
readonly get_node_usage: Tool<{
|
|
507
|
-
nodeName?: string | undefined;
|
|
508
|
-
}, any>;
|
|
509
|
-
readonly get_deployment_usage: Tool<{
|
|
510
|
-
namespace: string;
|
|
511
|
-
name: string;
|
|
512
|
-
}, {
|
|
513
|
-
deployment: string;
|
|
514
|
-
namespace: string;
|
|
515
|
-
podCount: number;
|
|
516
|
-
cpuMillicores: number;
|
|
517
|
-
memoryMB: number;
|
|
518
|
-
timestamp: any;
|
|
519
|
-
error?: undefined;
|
|
520
|
-
} | {
|
|
521
|
-
error: any;
|
|
522
|
-
deployment?: undefined;
|
|
523
|
-
namespace?: undefined;
|
|
524
|
-
podCount?: undefined;
|
|
525
|
-
cpuMillicores?: undefined;
|
|
526
|
-
memoryMB?: undefined;
|
|
527
|
-
timestamp?: undefined;
|
|
528
|
-
}>;
|
|
529
|
-
readonly get_prev_cluster_usage: Tool<{
|
|
530
|
-
count?: number | undefined;
|
|
531
|
-
}, {
|
|
532
|
-
vcpus: any;
|
|
533
|
-
memoryGB: number;
|
|
534
|
-
cpuUsagePercent: number;
|
|
535
|
-
memoryUsagePercent: number;
|
|
536
|
-
networkTxMbps: number;
|
|
537
|
-
networkRxMbps: number;
|
|
538
|
-
}[] | {
|
|
539
|
-
error: string;
|
|
540
|
-
}>;
|
|
541
|
-
readonly get_prev_node_usage: Tool<{
|
|
542
|
-
nodeName?: string | undefined;
|
|
543
|
-
count?: number | undefined;
|
|
544
|
-
}, {
|
|
545
|
-
nodes: any;
|
|
546
|
-
}[] | {
|
|
547
|
-
error: string;
|
|
548
|
-
}>;
|
|
549
|
-
readonly get_prev_deployment_usage: Tool<{
|
|
550
|
-
namespace: string;
|
|
551
|
-
name: string;
|
|
552
|
-
count?: number | undefined;
|
|
553
|
-
}, {
|
|
554
|
-
deployment: string;
|
|
555
|
-
namespace: string;
|
|
556
|
-
podCount: number;
|
|
557
|
-
cpuMillicores: number;
|
|
558
|
-
memoryMB: number;
|
|
559
|
-
timestamp: any;
|
|
560
|
-
}[] | {
|
|
561
|
-
error: any;
|
|
562
|
-
}>;
|
|
563
|
-
readonly get_prev_space_data: Tool<{
|
|
564
|
-
namespace: string;
|
|
565
|
-
count?: number | undefined;
|
|
566
|
-
}, {
|
|
567
|
-
namespace: string;
|
|
568
|
-
podCount: number;
|
|
569
|
-
cpuMillicores: number;
|
|
570
|
-
memoryMB: number;
|
|
571
|
-
timestamp: any;
|
|
572
|
-
}[] | {
|
|
573
|
-
error: string;
|
|
574
|
-
}>;
|
|
575
|
-
readonly add_node: Tool<{
|
|
576
|
-
nodeName?: string | undefined;
|
|
577
|
-
nodePoolName?: string | undefined;
|
|
578
|
-
}, {
|
|
579
|
-
success: boolean;
|
|
580
|
-
message: string;
|
|
581
|
-
stdout: string;
|
|
582
|
-
stderr: string;
|
|
583
|
-
error?: undefined;
|
|
584
|
-
} | {
|
|
585
|
-
success: boolean;
|
|
586
|
-
error: any;
|
|
587
|
-
message?: undefined;
|
|
588
|
-
stdout?: undefined;
|
|
589
|
-
stderr?: undefined;
|
|
590
|
-
} | {
|
|
591
|
-
success: boolean;
|
|
592
|
-
message: string;
|
|
593
|
-
stdout?: undefined;
|
|
594
|
-
stderr?: undefined;
|
|
595
|
-
error?: undefined;
|
|
596
|
-
}>;
|
|
597
|
-
readonly remove_node: Tool<{
|
|
598
|
-
nodeName: string;
|
|
599
|
-
nodePoolName?: string | undefined;
|
|
600
|
-
}, {
|
|
601
|
-
success: boolean;
|
|
602
|
-
message: string;
|
|
603
|
-
stdout: string;
|
|
604
|
-
stderr: string;
|
|
605
|
-
error?: undefined;
|
|
606
|
-
} | {
|
|
607
|
-
success: boolean;
|
|
608
|
-
error: any;
|
|
609
|
-
message?: undefined;
|
|
610
|
-
stdout?: undefined;
|
|
611
|
-
stderr?: undefined;
|
|
612
|
-
} | {
|
|
613
|
-
success: boolean;
|
|
614
|
-
message: string;
|
|
615
|
-
stdout?: undefined;
|
|
616
|
-
stderr?: undefined;
|
|
617
|
-
error?: undefined;
|
|
618
|
-
}>;
|
|
619
|
-
readonly stop_node: Tool<{
|
|
620
|
-
nodeName: string;
|
|
621
|
-
}, {
|
|
622
|
-
success: boolean;
|
|
623
|
-
error: string;
|
|
624
|
-
message?: undefined;
|
|
625
|
-
stdout?: undefined;
|
|
626
|
-
stderr?: undefined;
|
|
627
|
-
} | {
|
|
628
|
-
success: boolean;
|
|
629
|
-
message: string;
|
|
630
|
-
error?: undefined;
|
|
631
|
-
stdout?: undefined;
|
|
632
|
-
stderr?: undefined;
|
|
633
|
-
} | {
|
|
634
|
-
success: boolean;
|
|
635
|
-
message: string;
|
|
636
|
-
stdout: string;
|
|
637
|
-
stderr: string;
|
|
638
|
-
error?: undefined;
|
|
639
|
-
}>;
|
|
640
|
-
readonly start_node: Tool<{
|
|
641
|
-
nodeName: string;
|
|
642
|
-
}, {
|
|
643
|
-
success: boolean;
|
|
644
|
-
message: string;
|
|
645
|
-
stdout: string;
|
|
646
|
-
stderr: string;
|
|
647
|
-
error?: undefined;
|
|
648
|
-
} | {
|
|
649
|
-
success: boolean;
|
|
650
|
-
error: any;
|
|
651
|
-
message?: undefined;
|
|
652
|
-
stdout?: undefined;
|
|
653
|
-
stderr?: undefined;
|
|
654
|
-
} | {
|
|
655
|
-
success: boolean;
|
|
656
|
-
message: string;
|
|
657
|
-
stdout?: undefined;
|
|
658
|
-
stderr?: undefined;
|
|
659
|
-
error?: undefined;
|
|
660
|
-
}>;
|
|
661
|
-
readonly add_replica: Tool<{
|
|
662
|
-
namespace: string;
|
|
663
|
-
name: string;
|
|
664
|
-
}, {
|
|
665
|
-
success: boolean;
|
|
666
|
-
message: string;
|
|
667
|
-
error?: undefined;
|
|
668
|
-
} | {
|
|
669
|
-
success: boolean;
|
|
670
|
-
error: any;
|
|
671
|
-
message?: undefined;
|
|
672
|
-
}>;
|
|
673
|
-
readonly remove_replica: Tool<{
|
|
674
|
-
namespace: string;
|
|
675
|
-
name: string;
|
|
676
|
-
}, {
|
|
677
|
-
success: boolean;
|
|
678
|
-
message: string;
|
|
679
|
-
error?: undefined;
|
|
680
|
-
} | {
|
|
681
|
-
success: boolean;
|
|
682
|
-
error: any;
|
|
683
|
-
message?: undefined;
|
|
684
|
-
}>;
|
|
685
|
-
readonly restart_deployment: Tool<{
|
|
686
|
-
namespace: string;
|
|
687
|
-
name: string;
|
|
688
|
-
}, {
|
|
689
|
-
success: boolean;
|
|
690
|
-
message: string;
|
|
691
|
-
error?: undefined;
|
|
692
|
-
} | {
|
|
693
|
-
success: boolean;
|
|
694
|
-
error: any;
|
|
695
|
-
message?: undefined;
|
|
696
|
-
}>;
|
|
697
|
-
readonly delete_pod: Tool<{
|
|
698
|
-
namespace: string;
|
|
699
|
-
name: string;
|
|
700
|
-
}, {
|
|
701
|
-
success: boolean;
|
|
702
|
-
message: string;
|
|
703
|
-
error?: undefined;
|
|
704
|
-
} | {
|
|
705
|
-
success: boolean;
|
|
706
|
-
error: any;
|
|
707
|
-
message?: undefined;
|
|
708
|
-
}>;
|
|
709
|
-
readonly times_two: Tool<{
|
|
710
|
-
data: number;
|
|
711
|
-
}, number>;
|
|
712
|
-
readonly father_of: Tool<{
|
|
713
|
-
data: string;
|
|
714
|
-
}, string>;
|
|
715
|
-
readonly get_certificate_info: Tool<{
|
|
716
|
-
hostname: string;
|
|
717
|
-
port?: number | undefined;
|
|
718
|
-
}, unknown>;
|
|
719
|
-
readonly get_cluster_events: Tool<{
|
|
720
|
-
warningsOnly?: boolean | undefined;
|
|
721
|
-
namespace?: string | undefined;
|
|
722
|
-
limit?: number | undefined;
|
|
723
|
-
}, {
|
|
724
|
-
count: number;
|
|
725
|
-
events: Record<string, unknown>[];
|
|
726
|
-
}>;
|
|
727
|
-
readonly get_object_events: Tool<{
|
|
728
|
-
namespace: string;
|
|
729
|
-
name: string;
|
|
730
|
-
}, {
|
|
731
|
-
count: number;
|
|
732
|
-
events: Record<string, unknown>[];
|
|
733
|
-
}>;
|
|
734
|
-
readonly get_pod_logs: Tool<{
|
|
735
|
-
namespace: string;
|
|
736
|
-
name: string;
|
|
737
|
-
container?: string | undefined;
|
|
738
|
-
previous?: boolean | undefined;
|
|
739
|
-
tailLines?: number | undefined;
|
|
740
|
-
}, {
|
|
741
|
-
namespace: string;
|
|
742
|
-
name: string;
|
|
743
|
-
container: string | null;
|
|
744
|
-
previous: boolean;
|
|
745
|
-
truncated: boolean;
|
|
746
|
-
logs: string;
|
|
747
|
-
error?: undefined;
|
|
748
|
-
} | {
|
|
749
|
-
error: any;
|
|
750
|
-
namespace?: undefined;
|
|
751
|
-
name?: undefined;
|
|
752
|
-
container?: undefined;
|
|
753
|
-
previous?: undefined;
|
|
754
|
-
truncated?: undefined;
|
|
755
|
-
logs?: undefined;
|
|
756
|
-
}>;
|
|
757
|
-
readonly describe_pod: Tool<{
|
|
758
|
-
namespace: string;
|
|
759
|
-
name: string;
|
|
760
|
-
}, {
|
|
761
|
-
name: string;
|
|
762
|
-
namespace: string;
|
|
763
|
-
phase: any;
|
|
764
|
-
node: any;
|
|
765
|
-
startTime: any;
|
|
766
|
-
reason: any;
|
|
767
|
-
message: any;
|
|
768
|
-
controlledBy: any;
|
|
769
|
-
source: {
|
|
770
|
-
repo: any;
|
|
771
|
-
revision: any;
|
|
772
|
-
} | undefined;
|
|
773
|
-
conditions: any;
|
|
774
|
-
containers: any;
|
|
775
|
-
initContainers: any;
|
|
776
|
-
spec: {
|
|
777
|
-
containers: any;
|
|
778
|
-
restartPolicy: any;
|
|
779
|
-
};
|
|
780
|
-
error?: undefined;
|
|
781
|
-
} | {
|
|
782
|
-
error: any;
|
|
783
|
-
name?: undefined;
|
|
784
|
-
namespace?: undefined;
|
|
785
|
-
phase?: undefined;
|
|
786
|
-
node?: undefined;
|
|
787
|
-
startTime?: undefined;
|
|
788
|
-
reason?: undefined;
|
|
789
|
-
message?: undefined;
|
|
790
|
-
controlledBy?: undefined;
|
|
791
|
-
source?: undefined;
|
|
792
|
-
conditions?: undefined;
|
|
793
|
-
containers?: undefined;
|
|
794
|
-
initContainers?: undefined;
|
|
795
|
-
spec?: undefined;
|
|
796
|
-
}>;
|
|
797
|
-
readonly get_pod_yaml: Tool<{
|
|
798
|
-
namespace: string;
|
|
799
|
-
name: string;
|
|
800
|
-
}, any>;
|
|
801
|
-
readonly get_deployment_yaml: Tool<{
|
|
802
|
-
namespace: string;
|
|
803
|
-
name: string;
|
|
804
|
-
}, any>;
|
|
805
|
-
readonly get_controller_yaml: Tool<{
|
|
806
|
-
namespace: string;
|
|
807
|
-
kind: "Deployment" | "StatefulSet" | "DaemonSet" | "ReplicaSet";
|
|
808
|
-
name: string;
|
|
809
|
-
}, any>;
|
|
810
|
-
readonly get_rollout_history: Tool<{
|
|
811
|
-
namespace: string;
|
|
812
|
-
name: string;
|
|
813
|
-
}, {
|
|
814
|
-
deployment: string;
|
|
815
|
-
namespace: string;
|
|
816
|
-
revisionCount: any;
|
|
817
|
-
revisions: any;
|
|
818
|
-
error?: undefined;
|
|
819
|
-
} | {
|
|
820
|
-
error: any;
|
|
821
|
-
deployment?: undefined;
|
|
822
|
-
namespace?: undefined;
|
|
823
|
-
revisionCount?: undefined;
|
|
824
|
-
revisions?: undefined;
|
|
825
|
-
}>;
|
|
826
|
-
readonly get_configmap: Tool<{
|
|
827
|
-
namespace: string;
|
|
828
|
-
name: string;
|
|
829
|
-
}, {
|
|
830
|
-
name: string;
|
|
831
|
-
namespace: string;
|
|
832
|
-
resourceVersion: any;
|
|
833
|
-
lastModified: string | undefined;
|
|
834
|
-
data: any;
|
|
835
|
-
binaryDataKeys: string[];
|
|
836
|
-
error?: undefined;
|
|
837
|
-
} | {
|
|
838
|
-
error: any;
|
|
839
|
-
name?: undefined;
|
|
840
|
-
namespace?: undefined;
|
|
841
|
-
resourceVersion?: undefined;
|
|
842
|
-
lastModified?: undefined;
|
|
843
|
-
data?: undefined;
|
|
844
|
-
binaryDataKeys?: undefined;
|
|
845
|
-
}>;
|
|
846
|
-
readonly get_secret: Tool<{
|
|
847
|
-
namespace: string;
|
|
848
|
-
name: string;
|
|
849
|
-
}, {
|
|
850
|
-
name: string;
|
|
851
|
-
namespace: string;
|
|
852
|
-
type: any;
|
|
853
|
-
resourceVersion: any;
|
|
854
|
-
lastModified: string | undefined;
|
|
855
|
-
keys: string[];
|
|
856
|
-
error?: undefined;
|
|
857
|
-
} | {
|
|
858
|
-
error: any;
|
|
859
|
-
name?: undefined;
|
|
860
|
-
namespace?: undefined;
|
|
861
|
-
type?: undefined;
|
|
862
|
-
resourceVersion?: undefined;
|
|
863
|
-
lastModified?: undefined;
|
|
864
|
-
keys?: undefined;
|
|
865
|
-
}>;
|
|
866
|
-
readonly get_workload_config_refs: Tool<{
|
|
867
|
-
namespace: string;
|
|
868
|
-
name: string;
|
|
869
|
-
}, {
|
|
870
|
-
deployment: string;
|
|
871
|
-
namespace: string;
|
|
872
|
-
refs: ({
|
|
873
|
-
resourceVersion: any;
|
|
874
|
-
lastModified: string | undefined;
|
|
875
|
-
kind: string;
|
|
876
|
-
name: string;
|
|
877
|
-
via: string[];
|
|
878
|
-
} | {
|
|
879
|
-
error: any;
|
|
880
|
-
kind: string;
|
|
881
|
-
name: string;
|
|
882
|
-
via: string[];
|
|
883
|
-
})[];
|
|
884
|
-
error?: undefined;
|
|
885
|
-
} | {
|
|
886
|
-
error: any;
|
|
887
|
-
deployment?: undefined;
|
|
888
|
-
namespace?: undefined;
|
|
889
|
-
refs?: undefined;
|
|
890
|
-
}>;
|
|
891
|
-
readonly get_source_file: Tool<{
|
|
892
|
-
repo: string;
|
|
893
|
-
ref: string;
|
|
894
|
-
path: string;
|
|
895
|
-
}, {
|
|
896
|
-
repo: string;
|
|
897
|
-
ref: string;
|
|
898
|
-
path: string;
|
|
899
|
-
truncated: boolean;
|
|
900
|
-
content: string;
|
|
901
|
-
error?: undefined;
|
|
902
|
-
} | {
|
|
903
|
-
error: any;
|
|
904
|
-
repo?: undefined;
|
|
905
|
-
ref?: undefined;
|
|
906
|
-
path?: undefined;
|
|
907
|
-
truncated?: undefined;
|
|
908
|
-
content?: undefined;
|
|
909
|
-
}>;
|
|
910
|
-
};
|
|
911
|
-
export declare const toolInfoList: IToolInfo[];
|
|
912
299
|
export interface IAgentRunResult {
|
|
913
300
|
text: string;
|
|
914
301
|
inputTokens: number;
|
|
@@ -916,5 +303,3 @@ export interface IAgentRunResult {
|
|
|
916
303
|
steps: number;
|
|
917
304
|
toolCalls: string[];
|
|
918
305
|
}
|
|
919
|
-
export declare const selectAgentToolNames: (agent: IAgent) => string[];
|
|
920
|
-
export declare const runAgent: (agent: IAgent, prompt: string, llms: ILlm[], providers: ILlmProvider[], context: IToolContext) => Promise<IAgentRunResult>;
|